public class SocketFactory
extends java.lang.Object
Constructor and Description |
---|
SocketFactory() |
Modifier and Type | Method and Description |
---|---|
Socket |
createSocket(java.lang.String host,
int port)
Creates a socket and connects it to the specified remote host at the specified remote port.
|
Socket |
createSocket(java.lang.String host,
int port,
int timeout)
Creates a socket and connects it to the specified remote host at the specified remote port.
|
static SocketFactory |
getDefault() |
public static SocketFactory getDefault()
public Socket createSocket(java.lang.String host, int port) throws UnknownHostException, IOException
host
- the server hostport
- the server portUnknownHostException
- if the host is not knownIOException
- if an I/O error occurs when creating the socketSocket.Socket(String, int)
public Socket createSocket(java.lang.String host, int port, int timeout) throws UnknownHostException, IOException
host
- the server hostport
- the server portUnknownHostException
- if the host is not knownIOException
- if an I/O error occurs when creating the socketSocket.Socket(String, int)