1 ///建立客户端socket连接,指定服务器位置及端口 SERVICEIP:IP,PORT:端口号 2 Socket socket =new Socket(); 3 SocketAddress address = new InetSocketAddress(SERVICEIP,PORT); 4 socket.connect(address,5000); //超时为5000毫秒
1 ///建立客户端socket连接,指定服务器位置及端口 SERVICEIP:IP,PORT:端口号 2 Socket socket =new Socket(); 3 SocketAddress address = new InetSocketAddress(SERVICEIP,PORT); 4 socket.connect(address,5000); //超时为5000毫秒
转载于:https://www.cnblogs.com/zt-zoro/articles/3910043.html