Reputation: 145
I'm able to create docker container for ACE-TAO service , and able to access it from parent windows machine using port-forwarding concept.
From browser i try to hit the localhost:forward-port
and getting "ERR_EMPTY_RESPONSE"
and TAO service is running in docker container.
If I want to verify in local, whether its connected properly or not.
How can I write Java
code to verify?
Upvotes: 1
Views: 114
Reputation: 9401
The following java code connects to localhost:17500
and prints out a message saying whether or not it could create a tcp connection.
import java.io.*;
import java.net.*;
class TCPClient
{
public static void main(String argv[]) throws Exception
{
try {
Socket clientSocket = new Socket("localhost", 17500);
System.out.println("Could connect");
}
catch (ConnectException e) {
System.out.println("Cannot connect");
}
}
}
Upvotes: 0