Here you can find the source of createClientSocket(InetSocketAddress site)
public static Socket createClientSocket(InetSocketAddress site) throws IOException
//package com.java2s; import java.net.*; import java.io.*; public class Main { public static final int RECV_BUF_SIZE = 1000000; public static final int SEND_BUF_SIZE = 1000000; public static Socket createClientSocket(InetSocketAddress site) throws IOException { Socket socket = new Socket(); socket.setTcpNoDelay(true);/*from w w w . j av a 2 s .c o m*/ socket.setReceiveBufferSize(RECV_BUF_SIZE); socket.setSendBufferSize(SEND_BUF_SIZE); socket.bind(null); socket.connect(site); return socket; } }