-
createSocket
public abstract Socket createSocket(String host,
int port,
InetAddress localHost,
int localPort)
throws IOException,
UnknownHostException
Creates a socket and connects it to the specified remote host on the specified remote port. The socket will also be bound to the local address and port supplied. This socket is configured using the socket options established for this factory. If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.
-
Parameters:
-
host - the server host name with which to connect, or null for the loopback address.
-
port - the server port
-
localHost - the local address the socket is bound to
-
localPort - the local port the socket is bound to
-
Returns:
- the
Socket
-
Throws:
-
IOException - if an I/O error occurs when creating the socket
-
SecurityException - if a security manager exists and its checkConnect method doesn't allow the operation.
-
UnknownHostException - if the host is not known
-
IllegalArgumentException - if the port parameter or localPort parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
-
See Also:
-
SecurityManager.checkConnect(java.lang.String, int) , Socket.Socket(String, int, java.net.InetAddress, int)
|
-
createSocket
public abstract Socket createSocket(String host,
int port,
InetAddress localHost,
int localPort)
throws IOException,
UnknownHostException
Creates a socket and connects it to the specified remote host on the specified remote port. The socket will also be bound to the local address and port supplied. This socket is configured using the socket options established for this factory. If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.
-
Parameters:
-
host - the server host name with which to connect, or null for the loopback address.
-
port - the server port
-
localHost - the local address the socket is bound to
-
localPort - the local port the socket is bound to
-
Returns:
- the
Socket
-
Throws:
-
IOException - if an I/O error occurs when creating the socket
-
SecurityException - if a security manager exists and its checkConnect method doesn't allow the operation.
-
UnknownHostException - if the host is not known
-
IllegalArgumentException - if the port parameter or localPort parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
-
See Also:
-
SecurityManager.checkConnect(java.lang.String, int) , Socket.Socket(String, int, java.net.InetAddress, int)
|
-
createSocket
public abstract Socket createSocket(String host,
int port,
InetAddress localHost,
int localPort)
throws IOException,
UnknownHostException
Creates a socket and connects it to the specified remote host on the specified remote port. The socket will also be bound to the local address and port supplied. This socket is configured using the socket options established for this factory. If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.
-
Parameters:
-
host - the server host name with which to connect, or null for the loopback address.
-
port - the server port
-
localHost - the local address the socket is bound to
-
localPort - the local port the socket is bound to
-
Returns:
- the
Socket
-
Throws:
-
IOException - if an I/O error occurs when creating the socket
-
SecurityException - if a security manager exists and its checkConnect method doesn't allow the operation.
-
UnknownHostException - if the host is not known
-
IllegalArgumentException - if the port parameter or localPort parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
-
See Also:
-
SecurityManager.checkConnect(java.lang.String, int) , Socket(String, int, java.net.InetAddress, int)
|
|