public abstract class

ServerSocketFactory

extends Object
java.lang.Object
   ↳ javax.net.ServerSocketFactory
Known Direct Subclasses

Class Overview

This abstract class defines methods to create server sockets. It can be subclassed to create specific server socket types.

Summary

Protected Constructors
ServerSocketFactory()
Creates a new ServerSocketFactory instance.
Public Methods
abstract ServerSocket createServerSocket(int port, int backlog, InetAddress iAddress)
Creates a new server socket which is bound to the given address on the specified port and configures its maximum of queued connections.
abstract ServerSocket createServerSocket(int port, int backlog)
Creates a new server socket which is bound to the given port and configures its maximum of queued connections.
abstract ServerSocket createServerSocket(int port)
Creates a new server socket which is bound to the given port.
ServerSocket createServerSocket()
Creates a new server socket which is not bound to any local address.
synchronized static ServerSocketFactory getDefault()
Gets the default server socket factory of the system which can be used to create new server sockets without creating a subclass of this factory.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected ServerSocketFactory ()

Creates a new ServerSocketFactory instance.

Public Methods

public abstract ServerSocket createServerSocket (int port, int backlog, InetAddress iAddress)

Creates a new server socket which is bound to the given address on the specified port and configures its maximum of queued connections.

Parameters
port the port on which the created socket has to listen.
backlog the maximum of queued connections.
iAddress the address of the network interface which is used by the created socket.
Returns
  • the created bound server socket.
Throws
IOException if an error occurs while creating a new server socket.

public abstract ServerSocket createServerSocket (int port, int backlog)

Creates a new server socket which is bound to the given port and configures its maximum of queued connections.

Parameters
port the port on which the created socket has to listen.
backlog the maximum of queued connections.
Returns
  • the created bound server socket.
Throws
IOException if an error occurs while creating a new server socket.

public abstract ServerSocket createServerSocket (int port)

Creates a new server socket which is bound to the given port.

Parameters
port the port on which the created socket has to listen.
Returns
  • the created bound server socket.
Throws
IOException if an error occurs while creating a new server socket.

public ServerSocket createServerSocket ()

Creates a new server socket which is not bound to any local address. This method has to be overridden by a subclass otherwise a SocketException is thrown.

Returns
  • the created unbound server socket.
Throws
IOException if an error occurs while creating a new server socket.

public static synchronized ServerSocketFactory getDefault ()

Gets the default server socket factory of the system which can be used to create new server sockets without creating a subclass of this factory.

Returns
  • the system default server socket factory.