Socket s=new Socket("192.168.0.1",8888); Creates a stream socket and connects it to the specified port number at the specified IP address. s.setSoTimeout(long); Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.boolean isClosed() Returns the closed state of the socket.boolean isConnected() Returns the connection state of the socket.
Creates a stream socket and connects it to the specified port number at the specified IP address. s.setSoTimeout(long);
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.boolean isClosed() Returns the closed state of the socket.boolean isConnected() Returns the connection state of the socket.
s.isClose()
通信结束 要断开连接 因为如果客户通信结束,而服务器当然也要与其断开连接
isConnect()
接通 可以通信