org.apache.commons.net
public class DefaultSocketFactory extends Object implements SocketFactory
See Also: SocketFactory SocketClient SocketClient
Method Summary | |
---|---|
ServerSocket | createServerSocket(int port)
Creates a ServerSocket bound to a specified port. |
ServerSocket | createServerSocket(int port, int backlog)
Creates a ServerSocket bound to a specified port with a given
maximum queue length for incoming connections. |
ServerSocket | createServerSocket(int port, int backlog, InetAddress bindAddr)
Creates a ServerSocket bound to a specified port on a given local
address with a given maximum queue length for incoming connections.
|
Socket | createSocket(String host, int port)
Creates a Socket connected to the given host and port.
|
Socket | createSocket(InetAddress address, int port)
Creates a Socket connected to the given host and port.
|
Socket | createSocket(String host, int port, InetAddress localAddr, int localPort)
Creates a Socket connected to the given host and port and
originating from the specified local address and port.
|
Socket | createSocket(InetAddress address, int port, InetAddress localAddr, int localPort)
Creates a Socket connected to the given host and port and
originating from the specified local address and port.
|
Parameters: port The port on which to listen, or 0 to use any free port.
Returns: A ServerSocket that will listen on a specified port.
Throws: IOException If an I/O error occurs while creating the ServerSocket.
Parameters: port The port on which to listen, or 0 to use any free port. backlog The maximum length of the queue for incoming connections.
Returns: A ServerSocket that will listen on a specified port.
Throws: IOException If an I/O error occurs while creating the ServerSocket.
Parameters: port The port on which to listen, or 0 to use any free port. backlog The maximum length of the queue for incoming connections. bindAddr The local address to which the ServerSocket should bind.
Returns: A ServerSocket that will listen on a specified port.
Throws: IOException If an I/O error occurs while creating the ServerSocket.
Parameters: host The hostname to connect to. port The port to connect to.
Returns: A Socket connected to the given host and port.
Throws: UnknownHostException If the hostname cannot be resolved. IOException If an I/O error occurs while creating the Socket.
Parameters: address The address of the host to connect to. port The port to connect to.
Returns: A Socket connected to the given host and port.
Throws: IOException If an I/O error occurs while creating the Socket.
Parameters: host The hostname to connect to. port The port to connect to. localAddr The local address to use. localPort The local port to use.
Returns: A Socket connected to the given host and port.
Throws: UnknownHostException If the hostname cannot be resolved. IOException If an I/O error occurs while creating the Socket.
Parameters: address The address of the host to connect to. port The port to connect to. localAddr The local address to use. localPort The local port to use.
Returns: A Socket connected to the given host and port.
Throws: IOException If an I/O error occurs while creating the Socket.