Here you can find the source of createSocket(String host, int port)
public static Socket createSocket(String host, int port) throws UnknownHostException, IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; public class Main { public static Socket createSocket(String host, int port) throws UnknownHostException, IOException { return new Socket(host, port); }// w w w . j a va 2 s . co m }