All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----java.net.ServerSocket
The actual work of the server socket is performed by an instance
of the SocketImpl
class. An application can
change the socket factory that creates the socket
implementation to configure itself to create sockets
appropriate to the local firewall.
String
.
public ServerSocket(int port) throws IOException
0
creates a socket on any free port.
The maximum queue length for incoming connection indications (a
request to connect) is set to 50
. If a connection
indication arrives when the queue is full, the connection is refused.
If the application has specified a server socket factory, that
factory's createSocketImpl
method is called to create
the actual socket implementation. Otherwise a "plain" socket is created.
0
to use any
free port.
public ServerSocket(int port,
int backlog) throws IOException
0
creates a socket on any
free port.
The maximum queue length for incoming connection indications (a
request to connect) is set to the count
parameter. If
a connection indication arrives when the queue is full, the
connection is refused.
If the application has specified a server socket factory, that
factory's createSocketImpl
method is called to create
the actual socket implementation. Otherwise a "plain" socket is created.
0
to use
any free port.
public ServerSocket(int port,
int backlog,
InetAddress bindAddr) throws IOException
public InetAddress getInetAddress()
null
if the socket is not yet connected.
public int getLocalPort()
public Socket accept() throws IOException
protected final void implAccept(Socket s) throws IOException
public void close() throws IOException
public synchronized void setSoTimeout(int timeout) throws SocketException
public synchronized int getSoTimeout() throws IOException
public String toString()
String
.
public static synchronized void setSocketFactory(SocketImplFactory fac) throws IOException
When an application creates a new server socket, the socket
implementation factory's createSocketImpl
method is
called to create the actual socket implementation.
All Packages Class Hierarchy This Package Previous Next Index