@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class SynchronizedSocketFactory extends javax.net.SocketFactory
Constructor and Description |
---|
SynchronizedSocketFactory(javax.net.SocketFactory factory)
Creates a new synchronous socket factory instance that will wrap the
provided socket factory.
|
Modifier and Type | Method and Description |
---|---|
java.net.Socket |
createSocket(java.net.InetAddress address,
int port)
Creates a new socket to the specified server.
|
java.net.Socket |
createSocket(java.net.InetAddress address,
int port,
java.net.InetAddress localAddress,
int localPort)
Creates a new socket to the specified server.
|
java.net.Socket |
createSocket(java.lang.String host,
int port)
Creates a new socket to the specified server.
|
java.net.Socket |
createSocket(java.lang.String host,
int port,
java.net.InetAddress localAddress,
int localPort)
Creates a new socket to the specified server.
|
javax.net.SocketFactory |
getWrappedSocketFactory()
Retrieves the
SocketFactory instance wrapped by this synchronized
socket factory. |
public SynchronizedSocketFactory(@NotNull javax.net.SocketFactory factory)
factory
- The socket factory to be wrapped.@NotNull public javax.net.SocketFactory getWrappedSocketFactory()
SocketFactory
instance wrapped by this synchronized
socket factory.SocketFactory
instance wrapped by this synchronized
socket factory.@NotNull public java.net.Socket createSocket(@NotNull java.lang.String host, int port) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
host
- The host to which the connection should be established.port
- The port to which the connection should be established.java.io.IOException
- If a problem occurs while creating the socket.@NotNull public java.net.Socket createSocket(@NotNull java.lang.String host, int port, @NotNull java.net.InetAddress localAddress, int localPort) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
host
- The host to which the connection should be
established.port
- The port to which the connection should be
established.localAddress
- The local address to use for the connection.localPort
- The local port to use for the connection.java.io.IOException
- If a problem occurs while creating the socket.@NotNull public java.net.Socket createSocket(@NotNull java.net.InetAddress address, int port) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
address
- The address to which the connection should be established.port
- The port to which the connection should be established.java.io.IOException
- If a problem occurs while creating the socket.@NotNull public java.net.Socket createSocket(@NotNull java.net.InetAddress address, int port, @NotNull java.net.InetAddress localAddress, int localPort) throws java.io.IOException
createSocket
in class javax.net.SocketFactory
address
- The address to which the connection should be
established.port
- The port to which the connection should be
established.localAddress
- The local address to use for the connection.localPort
- The local port to use for the connection.java.io.IOException
- If a problem occurs while creating the socket.