public class TestIp {
public static void main(String[] args) {
Socket connect = new Socket();

try {
connect.connect(new InetSocketAddress("192.168.0.59", 8071),100);

boolean res = connect.isConnected();
System.out.println("" + res);
} catch (IOException e) {
e.printStackTrace();
}finally{
try {
connect.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

posted on 2016-11-25 09:20  xue123  阅读(702)  评论(0编辑  收藏  举报