[英]How to verify the ACE-CORBA service local windows machine
I'm able to create docker container for ACE-TAO service , and able to access it from parent windows machine using port-forwarding concept. 我能够为ACE-TAO服务创建docker容器,并能够使用端口转发概念从父Windows机器访问它。
From browser i try to hit the localhost:forward-port
and getting "ERR_EMPTY_RESPONSE"
and TAO service is running in docker container. 从浏览器我尝试命中localhost:forward-port
并获取"ERR_EMPTY_RESPONSE"
并且TAO服务在"ERR_EMPTY_RESPONSE"
容器中运行。
If I want to verify in local, whether its connected properly or not. 如果我想在本地验证,是否正确连接。
How can I write Java
code to verify? 如何编写Java
代码进行验证?
The following java code connects to localhost:17500
and prints out a message saying whether or not it could create a tcp connection. 以下java代码连接到localhost:17500
并打印出一条消息,说明它是否可以创建tcp连接。
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");
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.