org.apache.commons.httpclient.protocol
Interface ProtocolSocketFactory

All Known Subinterfaces:
SecureProtocolSocketFactory
All Known Implementing Classes:
DefaultProtocolSocketFactory, SSLProtocolSocketFactory

public interface ProtocolSocketFactory

A factory for creating Sockets.

Since:
2.0
Author:
Michael Becke
See Also:
Protocol

Method Summary
 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 clientHost, int clientPort)
          Gets a new socket connection to the given host.
 

Method Detail

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port,
                                    java.net.InetAddress clientHost,
                                    int clientPort)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Gets a new socket connection to the given host.

Parameters:
host - the host name/IP
port - the port on the host
clientHost - the local host name/IP to bind the socket to
clientPort - the port on the local machine
Returns:
Socket a new socket
Throws:
java.io.IOException - if an I/O error occurs while creating the socket
java.net.UnknownHostException - if the IP address of the host cannot be determined

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException,
                                    java.net.UnknownHostException
Gets a new socket connection to the given host.

Parameters:
host - the host name/IP
port - the port on the host
Returns:
Socket a new socket
Throws:
java.io.IOException - if an I/O error occurs while creating the socket
java.net.UnknownHostException - if the IP address of the host cannot be determined


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.