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
 Socket createSocket(InetAddress address, int port)
          Create a socket and connect to remote address specified.
 Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
          Create a socket and connect to remote address specified originating from specified local address.
 

Method Detail

createSocket

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

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

createSocket

public Socket createSocket(InetAddress address,
                           int port,
                           InetAddress localAddress,
                           int localPort)
                    throws 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:
IOException - if an error occurs


Copyright © Apache Software Foundation. All Rights Reserved.