org.apache.avalon.cornerstone.blocks.sockets
Class DefaultSocketFactory

java.lang.Object
  extended byorg.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory
All Implemented Interfaces:
SocketFactory

public class DefaultSocketFactory
extends java.lang.Object
implements SocketFactory

The vanilla implementation of SocketFactory.

Author:
Peter Donald

Constructor Summary
DefaultSocketFactory()
           
 
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.
 
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 java.net.Socket createSocket(java.net.InetAddress address,
                                    int port)
                             throws java.io.IOException
Create a socket and connect to remote address specified.

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

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
Throws:
java.io.IOException - if an error occurs


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