org.apache.avalon.cornerstone.blocks.sockets
Class DefaultSocketFactory
java.lang.Object
org.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
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 |
DefaultSocketFactory
public DefaultSocketFactory()
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 addressport
- 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 addressport
- the remote portlocalAddress
- the local addresslocalPort
- the local port
- Returns:
- the socket
- Throws:
java.io.IOException
- if an error occurs
Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.