Interface SocketFactory

All Known Implementing Classes:
DefaultSocketFactory

public interface SocketFactory
Factory to create various types of sockets. For socket creation, a service name can be passed as argument: an implementation could look up a service description (e.g. port) and create the socket, ignoring the passed port and possibly also the bind address.

Ephemeral ports can be created by passing 0 as port, or (if the port is ignored), an implementation could pass in a special service name (e.g. "EPHEMERAL"), this is implementation dependent.

The socket creation methods have the same parameter lists as the socket constructors, e.g. createServerSocket(String, int, int) is the same as ServerSocket(int, int).