Java HTTP Port Find isStart(String host, int port)

Here you can find the source of isStart(String host, int port)

Description

is Start

License

Open Source License

Declaration

public static boolean isStart(String host, int port) 

Method Source Code


//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;
    }
}

Related

  1. isReachableByPing(String host, int port)
  2. isServerListening(String host, int port)
  3. isServerListening(String host, int port)
  4. isServerPortFree(int port)
  5. isServing(String host, int port)
  6. isStart0(String host, int port)
  7. issueHttpRequest(String methodName, int[] rc, String host, String port, String path)
  8. isTcpPortOpen(int port)
  9. isTcpPortOpenCallable(final int port)