你好,我正在制作一个服务器,它将在端口 6112 上侦听并说如果客户端连接到它,我已经尝试用两种语言进行操作..但是它侦听连接并且没有检测到任何东西..有什么帮助吗?
继承人的代码例如:
public static ServerSocket Start() throws Exception
{
System.out.println("Initializing Network Listener");
Config.Initialize();
int netport = Config.netport;
String netip=Config.netadress;
ServerSocket Listener = new ServerSocket(netport);
System.out.println("Done initializing Network Listener");
Listener.setSoTimeout(0);
return Listener;
}
public static void ListenForClient() throws Exception
{
ServerSocket Listener = Start();
Listener.setSoTimeout(0);
Socket Client = Listener.accept();
Client.setSoTimeout(120000);
System.out.println("Client Connected on port: ");
}