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 Object
- implements SocketFactory
The vanilla implementation of SocketFactory.
- Author:
- Peter Donald
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultSocketFactory
public DefaultSocketFactory()
createSocket
public Socket createSocket(InetAddress address,
int port)
throws 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:
IOException - if an error occurs
createSocket
public 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.
- Specified by:
createSocket in interface SocketFactory
- Parameters:
address - the remote addressport - the remote portlocalAddress - the local addresslocalPort - the local port
- Returns:
- the socket
- Throws:
IOException - if an error occurs
Copyright © 2012 Apache Software Foundation. All Rights Reserved.