Java Socket Create getSocketToProxyServer(String host, int port)

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

Description

get Socket To Proxy Server

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.net.InetSocketAddress;
import java.net.Socket;

public class Main {
    public static Socket getSocketToProxyServer(String host, int port) throws IOException {
        Socket socket = new Socket();
        socket.connect(new InetSocketAddress(host, port), 1000);
        socket.setSoTimeout(300000);/*from  w  w w.  j  av  a2  s .  c om*/
        return socket;
    }
}

Related

  1. getSocket(String i_HostName, int i_Port)
  2. getSocketFromString(String s)
  3. getSocketId(Socket socket)
  4. getSocketInRange(int minPort, int maxPort, boolean random)
  5. getSocketToBytes(String ip, int port, String packet, int timeout)