Interface ProtocolSocketFactory
- All Known Subinterfaces:
SecureProtocolSocketFactory
- All Known Implementing Classes:
DefaultProtocolSocketFactory
,EasySSLProtocolSocketFactory
,SSLProtocolSocketFactory
Deprecated.
Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
It is not recommended to use it in any new code.
Instead, use HTTP client API plugins as a dependency in your code.
E.g.
Apache HttpComponents Client API 4.x Plugin or
Async HTTP Client Plugin.
A factory for creating Sockets.
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.
- Since:
- 2.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateSocket
(String host, int port) Deprecated.Gets a new socket connection to the given host.createSocket
(String host, int port, InetAddress localAddress, int localPort) Deprecated.Gets a new socket connection to the given host.createSocket
(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) Deprecated.Gets a new socket connection to the given host.
-
Method Details
-
createSocket
Socket createSocket(String host, int port, InetAddress localAddress, int localPort) throws IOException, UnknownHostException Deprecated.Gets a new socket connection to the given host.- Parameters:
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 machine- Returns:
- Socket a new socket
- Throws:
IOException
- if an I/O error occurs while creating the socketUnknownHostException
- if the IP address of the host cannot be determined
-
createSocket
Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException, UnknownHostException, ConnectTimeoutException Deprecated.Gets a new socket connection to the given host.- Parameters:
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
- Returns:
- Socket a new socket
- Throws:
IOException
- if an I/O error occurs while creating the socketUnknownHostException
- if the IP address of the host cannot be determinedConnectTimeoutException
- if socket cannot be connected within the given time limit- Since:
- 3.0
-
createSocket
Deprecated.Gets a new socket connection to the given host.- Parameters:
host
- the host name/IPport
- the port on the host- Returns:
- Socket a new socket
- Throws:
IOException
- if an I/O error occurs while creating the socketUnknownHostException
- if the IP address of the host cannot be determined
-