Socket socket = new Socket();
SocketAddress address = new InetSocketAddress("localhost",8080)
socket.connect(address)
可以传入一个int作为第二个参数,制定连接超时之前等待的时间
socket.connect(address,3*1000)