public interface ProtocolSocketFactory
Both Object.equals()
and
Object.hashCode()
should be overridden appropriately.
Protocol socket factories are used to uniquely identify Protocol
s and
HostConfiguration
s, and equals()
and hashCode()
are
required for the correct operation of some connection managers.
Protocol
Modifier and Type | Method and Description |
---|---|
java.net.Socket |
createSocket(java.lang.String host,
int port)
Gets a new socket connection to the given host.
|
java.net.Socket |
createSocket(java.lang.String host,
int port,
java.net.InetAddress localAddress,
int localPort)
Gets a new socket connection to the given host.
|
java.net.Socket |
createSocket(java.lang.String host,
int port,
java.net.InetAddress localAddress,
int localPort,
HttpConnectionParams params)
Gets a new socket connection to the given host.
|
java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress localAddress, int localPort) throws java.io.IOException, java.net.UnknownHostException
host
- the host name/IPport
- the port on the hostlocalAddress
- the local host name/IP to bind the socket tolocalPort
- the port on the local machinejava.io.IOException
- if an I/O error occurs while creating the socketjava.net.UnknownHostException
- if the IP address of the host cannot be
determinedjava.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress localAddress, int localPort, HttpConnectionParams params) throws java.io.IOException, java.net.UnknownHostException, ConnectTimeoutException
host
- the host name/IPport
- the port on the hostlocalAddress
- the local host name/IP to bind the socket tolocalPort
- the port on the local machineparams
- Http connection parameters
java.io.IOException
- if an I/O error occurs while creating the socketjava.net.UnknownHostException
- if the IP address of the host cannot be
determinedConnectTimeoutException
- if socket cannot be connected within the
given time limitjava.net.Socket createSocket(java.lang.String host, int port) throws java.io.IOException, java.net.UnknownHostException
host
- the host name/IPport
- the port on the hostjava.io.IOException
- if an I/O error occurs while creating the socketjava.net.UnknownHostException
- if the IP address of the host cannot be
determinedCopyright (c) 1999-2005 - Apache Software Foundation