Java Socket Create getSocket(String host, int port)

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

Description

get Socket

License

Apache License

Declaration

public static Socket getSocket(String host, int port) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;

import java.net.Socket;

public class Main {
    public static Socket getSocket(String host, int port) throws IOException {
        if (host == null || port == -1)
            throw new IllegalArgumentException("Missing required arguments: host and/or port");
        return new Socket(host, port);
    }/*from  ww  w .java  2s .co  m*/
}

Related

  1. createSocketAddress(String server)
  2. createSocketAddrForHost(String hostName, int port)
  3. createSocketServer(int port)
  4. getSocket()
  5. getSocket(String host, int port)
  6. getSocket(String host, int port, int timeout)
  7. getSocket(String i_HostName, int i_Port)
  8. getSocketFromString(String s)
  9. getSocketId(Socket socket)