public class TimedSocketWrapperFactory extends SocketFactory
Modifier and Type | Method and Description |
---|---|
Socket |
createSocket()
Creates a new socket.
|
Socket |
createSocket(InetAddress address,
int port)
Creates a stream socket and connects it to the specified port
number at the specified IP address.
|
Socket |
createSocket(InetAddress host,
int port,
InetAddress localAddr,
int localPort)
Creates a stream socket and connects it to the specified port using
a specified local address and port.
|
Socket |
createSocket(Proxy proxy)
Creates a socket through the given proxy.
|
Socket |
createSocket(String host,
int port)
Creates a new socket connected to the given host and port.
|
Socket |
createSocket(String host,
int port,
InetAddress localAddr,
int localPort)
Creates a stream socket and connects it to the specified port using
a specified local address and port.
|
getDefault
public Socket createSocket(Proxy proxy)
createSocket
in class SocketFactory
proxy
- The proxypublic Socket createSocket() throws IOException
createSocket
in class SocketFactory
IOException
- Error creating the socketpublic Socket createSocket(String host, int port) throws IOException, UnknownHostException
createSocket
in class SocketFactory
host
- The host to connectport
- The port to useIOException
- Error creating the socketUnknownHostException
- The host is unknownpublic Socket createSocket(String host, int port, InetAddress localAddr, int localPort) throws IOException, UnknownHostException
createSocket
in class SocketFactory
host
- the name of the remote host, or null
for the loopback address.port
- the remote portlocalAddr
- the local address the socket is bound tolocalPort
- the local port the socket is bound toIOException
- if an I/O error occurs when creating the socket.UnknownHostException
- The host is unknownpublic Socket createSocket(InetAddress address, int port) throws IOException
createSocket
in class SocketFactory
address
- the IP address.port
- the port number.IOException
- if an I/O error occurs when creating the socket.public Socket createSocket(InetAddress host, int port, InetAddress localAddr, int localPort) throws IOException
createSocket
in class SocketFactory
host
- the address of the remote hostport
- the remote portlocalAddr
- the local address the socket is bound tolocalPort
- the local port the socket is bound toIOException
- if an I/O error occurs when creating the socket.