java.lang.Object | |
↳ | javax.net.SocketFactory |
![]() |
![]() |
This class creates sockets. It may be subclassed by other factories, which create particular subclasses of sockets and thus provide a general framework for the addition of public socket-level functionality.
Socket factories are a simple way to capture a variety of policies related to the sockets being constructed, producing such sockets in a way which does not require special configuration of the code which asks for the sockets:
Factory classes are specified by environment-specific configuration mechanisms. For example, the getDefault method could return a factory that was appropriate for a particular user or applet, and a framework could use a factory customized to its own purposes.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a
SocketFactory . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a socket and connects it to the specified remote host
on the specified remote port.
| |||||||||||
Creates a socket and connect it to the specified remote address
on the specified remote port.
| |||||||||||
Creates a socket and connects it to the specified port number
at the specified address.
| |||||||||||
Creates a socket and connects it to the specified remote host
at the specified remote port.
| |||||||||||
Creates an unconnected socket.
| |||||||||||
Returns a copy of the environment's default socket factory.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates a SocketFactory
.
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.
host | the server host |
---|---|
port | the server port |
localHost | the local address the socket is bound to |
localPort | the local port the socket is bound to |
Socket
IOException | if an I/O error occurs when creating the socket |
---|---|
UnknownHostException | if the host is not known |
Creates a socket and connect it to the specified remote address on the specified remote port. The socket will also be bound to the local address and port suplied. The socket is configured using the socket options established for this factory.
address | the server network address |
---|---|
port | the server port |
localAddress | the client network address |
localPort | the client port |
Socket
IOException | if an I/O error occurs when creating the socket |
---|
Creates a socket and connects it to the specified port number at the specified address. This socket is configured using the socket options established for this factory.
host | the server host |
---|---|
port | the server port |
Socket
IOException | if an I/O error occurs when creating the socket |
---|
Creates a socket and connects it to the specified remote host at the specified remote port. This socket is configured using the socket options established for this factory.
host | the server host |
---|---|
port | the server port |
Socket
IOException | if an I/O error occurs when creating the socket |
---|---|
UnknownHostException | if the host is not known |
Creates an unconnected socket.
IOException | if the socket cannot be created |
---|
Returns a copy of the environment's default socket factory.
SocketFactory