Link 类中 sock = new Socket(host, port); ...... --> sock = new Socket(); ...... sock.connect(new InetSocketAddress(host, port), connect_timeout);