org.apache.http.conn.socket
Class PlainConnectionSocketFactory
java.lang.Object
   org.apache.http.conn.socket.PlainConnectionSocketFactory
org.apache.http.conn.socket.PlainConnectionSocketFactory
- All Implemented Interfaces: 
- ConnectionSocketFactory
- @Contract(threading=IMMUTABLE)
public class PlainConnectionSocketFactory 
- extends Object- implements ConnectionSocketFactory
The default class for creating plain (unencrypted) sockets.
- Since:
- 4.3
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
INSTANCE
public static final PlainConnectionSocketFactory INSTANCE
PlainConnectionSocketFactory
public PlainConnectionSocketFactory()
getSocketFactory
public static PlainConnectionSocketFactory getSocketFactory()
- 
 
- 
 
createSocket
public Socket createSocket(org.apache.http.protocol.HttpContext context)
                    throws IOException
- Description copied from interface: ConnectionSocketFactory
- Creates new, unconnected socket. The socket should subsequently be passed to
 connectSocketmethod.
 
- 
- Specified by:
- createSocketin interface- ConnectionSocketFactory
 
- 
- Returns:
- a new socket
- Throws:
- IOException- if an I/O error occurs while creating the socket
 
connectSocket
public Socket connectSocket(int connectTimeout,
                            Socket socket,
                            org.apache.http.HttpHost host,
                            InetSocketAddress remoteAddress,
                            InetSocketAddress localAddress,
                            org.apache.http.protocol.HttpContext context)
                     throws IOException
- Description copied from interface: ConnectionSocketFactory
- Connects the socket to the target host with the given resolved remote address.
 
- 
- Specified by:
- connectSocketin interface- ConnectionSocketFactory
 
- 
- Parameters:
- connectTimeout- connect timeout.
- socket- the socket to connect, as obtained from- ConnectionSocketFactory.createSocket(HttpContext).- nullindicates that a new socket should be created and connected.
- host- target host as specified by the caller (end user).
- remoteAddress- the resolved remote address to connect to.
- localAddress- the local address to bind the socket to, or- nullfor any.
- context- the actual HTTP context.
- Returns:
- the connected socket. The returned object may be different
          from the sockargument if this factory supports
          a layered protocol.
- Throws:
- IOException- if an I/O error occurs
 
Copyright © 1999–2020 The Apache Software Foundation. All rights reserved.