java.lang.Object | |
↳ | javax.net.SocketFactory |
Known Direct Subclasses |
Known Indirect Subclasses |
This abstract class defines methods to create sockets. It can be subclassed to create specific socket types with additional socket-level functionality.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new
SocketFactory instance. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new socket which is connected to the remote host specified by
the parameters
host and port . | |||||||||||
Creates a new socket which is connected to the remote host specified by
the InetAddress
address . | |||||||||||
Creates a new socket which is not connected to any remote host.
| |||||||||||
Creates a new socket which is connected to the remote host specified by
the parameters
host and port . | |||||||||||
Creates a new socket which is connected to the remote host specified by
the InetAddress
host . | |||||||||||
Gets the default socket factory of the system which can be used to create
new sockets without creating a subclass of this factory.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Creates a new socket which is connected to the remote host specified by
the parameters host
and port
. The socket is bound to any
available local address and port.
host | the remote host address the socket has to be connected to. |
---|---|
port | the port number of the remote host at which the socket is connected. |
IOException | if an error occurs while creating a new socket. |
---|---|
UnknownHostException | if the specified host is unknown or the IP address could not be resolved. |
Creates a new socket which is connected to the remote host specified by
the InetAddress address
. The socket is bound to the local network
interface specified by the InetAddress localHost
on port localPort
.
address | the remote host address the socket has to be connected to. |
---|---|
port | the port number of the remote host at which the socket is connected. |
localAddress | the local host address the socket is bound to. |
localPort | the port number of the local host at which the socket is bound. |
IOException | if an error occurs while creating a new socket. |
---|
Creates a new socket which is not connected to any remote host. This
method has to be overridden by a subclass otherwise a SocketException
is thrown.
IOException | if an error occurs while creating a new socket. |
---|
Creates a new socket which is connected to the remote host specified by
the parameters host
and port
. The socket is bound to the
local network interface specified by the InetAddress localHost
on
port localPort
.
host | the remote host address the socket has to be connected to. |
---|---|
port | the port number of the remote host at which the socket is connected. |
localHost | the local host address the socket is bound to. |
localPort | the port number of the local host at which the socket is bound. |
IOException | if an error occurs while creating a new socket. |
---|---|
UnknownHostException | if the specified host is unknown or the IP address could not be resolved. |
Creates a new socket which is connected to the remote host specified by
the InetAddress host
. The socket is bound to any available local
address and port.
host | the host address the socket has to be connected to. |
---|---|
port | the port number of the remote host at which the socket is connected. |
IOException | if an error occurs while creating a new socket. |
---|
Gets the default socket factory of the system which can be used to create new sockets without creating a subclass of this factory.