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


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

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

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 © 2012 The Apache Software Foundation. All Rights Reserved.