FileDocCategorySizeDatePackage
ServerSocketFactory.javaAPI DocAndroid 1.5 API4305Wed May 06 22:41:06 BST 2009javax.net

ServerSocketFactory

public abstract class ServerSocketFactory extends Object
This abstract class defines methods to create server sockets. It can be subclassed to create specific server socket types.
since
Android 1.0

Fields Summary
static ServerSocketFactory
defaultFactory
Constructors Summary
protected ServerSocketFactory()
Creates a new {@code ServerSocketFactory} instance.

since
Android 1.0

    
Methods Summary
public java.net.ServerSocketcreateServerSocket()
Creates a new server socket which is not bound to any local address. This method has to be overridden by a subclass otherwise a {@code SocketException} is thrown.

return
the created unbound server socket.
throws
IOException if an error occurs while creating a new server socket.
since
Android 1.0

        // follow RI's behavior 
        throw new SocketException("Unbound server sockets not implemented");
    
public abstract java.net.ServerSocketcreateServerSocket(int port)
Creates a new server socket which is bound to the given port.

param
port the port on which the created socket has to listen.
return
the created bound server socket.
throws
IOException if an error occurs while creating a new server socket.
since
Android 1.0

public abstract java.net.ServerSocketcreateServerSocket(int port, int backlog)
Creates a new server socket which is bound to the given port and configures its maximum of queued connections.

param
port the port on which the created socket has to listen.
param
backlog the maximum of queued connections.
return
the created bound server socket.
throws
IOException if an error occurs while creating a new server socket.
since
Android 1.0

public abstract java.net.ServerSocketcreateServerSocket(int port, int backlog, java.net.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.

param
port the port on which the created socket has to listen.
param
backlog the maximum of queued connections.
param
iAddress the address of the network interface which is used by the created socket.
return
the created bound server socket.
throws
IOException if an error occurs while creating a new server socket.
since
Android 1.0

public static synchronized javax.net.ServerSocketFactorygetDefault()
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.

return
the system default server socket factory.
since
Android 1.0

        if (defaultFactory == null) {
                defaultFactory = new DefaultServerSocketFactory();
        }
        return defaultFactory;