Java Socket Address Get createClientSocket(InetSocketAddress site)

Here you can find the source of createClientSocket(InetSocketAddress site)

Description

create Client Socket

License

Open Source License

Declaration

public static Socket createClientSocket(InetSocketAddress site) throws IOException 

Method Source Code


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

Related

  1. cast2SocketAddress(String addr)
  2. compareAddresses(InetSocketAddress addr1, InetSocketAddress addr2)
  3. convertToHostString(SocketAddress hostAddress)
  4. create(SocketAddress address, SocketAddress port)
  5. createBoundServerSocket(final SocketAddress socketAddress)
  6. createHttpFields(InetSocketAddress endpoint)
  7. createInetSocketAddress(String address)
  8. createInetSocketAddress(String ip, int port)
  9. describe(InetSocketAddress localAddress)