org.apache.avalon.cornerstone.services.sockets
Interface SocketFactory

All Known Implementing Classes:
DefaultSocketFactory, TLSSocketFactory

public interface SocketFactory

The interface used to create client sockets.

Author:
Peter Donald

Method Summary
 java.net.Socket createSocket(java.net.InetAddress address, int port)
          Create a socket and connect to remote address specified.
 java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddress, int localPort)
          Create a socket and connect to remote address specified originating from specified local address.
 

Method Detail

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port)
                             throws java.io.IOException
Create a socket and connect to remote address specified.

Parameters:
address - the remote address
port - the remote port
Returns:
the socket
Throws:
java.io.IOException - if an error occurs

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port,
                                    java.net.InetAddress localAddress,
                                    int localPort)
                             throws java.io.IOException
Create a socket and connect to remote address specified originating from specified local address.

Parameters:
address - the remote address
port - the remote port
localAddress - the local address
localPort - the local port
Returns:
the socket
Throws:
java.io.IOException - if an error occurs


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.