Here you can find the source of isStart(String host, int port)
public static boolean isStart(String host, int port)
//package com.java2s; //License from project: Open Source License import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; public class Main { public static boolean isStart(String host, int port) { return isStart1(host, port); }/*from w ww . jav a2s .co m*/ public static boolean isStart1(String host, int port) { boolean status = false; InetAddress addr = null; Socket socket = new Socket(); try { addr = InetAddress.getByName(host); socket.connect(new InetSocketAddress(addr, port), 100); status = true; socket.close(); } catch (Exception e) { } finally { } return status; } }