org.codehaus.spice.netserve.sockets.impl
Class DefaultSocketFactory

java.lang.Object
  extended byorg.codehaus.spice.netserve.sockets.impl.DefaultSocketFactory
All Implemented Interfaces:
SocketFactory

public class DefaultSocketFactory
extends Object
implements SocketFactory

A SocketFactory that creates vanilla sockets.

Version:
$Revision: 1.2 $ $Date: 2004/03/21 23:42:59 $
Author:
Peter Donald

Constructor Summary
DefaultSocketFactory()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSocketFactory

public DefaultSocketFactory()
Method Detail

createSocket

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

Specified by:
createSocket in interface SocketFactory
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.

Specified by:
createSocket in interface SocketFactory
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.