org.codehaus.spice.netserve.sockets
Interface SocketFactory

All Known Implementing Classes:
DefaultSocketFactory

public interface SocketFactory

Service used to create client sockets. The factory is used so that the exact socket type and underlying transport is abstracted. The sockets created could be proxied, SSL enabled, TLS enabled etc. However clients just care that they return sockets.

Version:
$Revision: 1.2 $ $Date: 2004/03/21 23:43:00 $
Author:
Peter Donald

Method Summary
 Socket createSocket(InetAddress address, int port)
          Create a socket that connects to specified remote address.
 Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
          Create a socket that connects to specified remote address and originates from specified local address.
 

Method Detail

createSocket

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

Parameters:
address - the remote address
port - the remote port
Returns:
the socket connected to remote address
Throws:
IOException - if unable to create socket

createSocket

public Socket createSocket(InetAddress address,
                           int port,
                           InetAddress localAddress,
                           int localPort)
                    throws IOException
Create a socket that connects to specified remote address and originates from specified local address.

Parameters:
address - the remote address
port - the remote port
localAddress - the local address
localPort - the local port
Returns:
the socket connected to remote address
Throws:
IOException - if unable to create socket


Copyright © 1999-2004 Codehaus. All Rights Reserved.