ServerSocket

public class ServerSocket extends Object
implements Closeable
Known Direct Subclasses

This class implements server sockets. A server socket waits for requests to come in over the network. It performs some operation based on that request, and then possibly returns a result to the requester.

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.

Public Constructor Summary

ServerSocket()
Creates an unbound server socket.
ServerSocket(int port)
Creates a server socket, bound to the specified port.
ServerSocket(int port, int backlog)
Creates a server socket and binds it to the specified local port number, with the specified backlog.
ServerSocket(int port, int backlog, InetAddress bindAddr)
Create a server with the specified port, listen backlog, and local IP address to bind to.

Public Method Summary

Socket
accept()
Listens for a connection to be made to this socket and accepts it.
void
bind(SocketAddress endpoint, int backlog)
Binds the ServerSocket to a specific address (IP address and port number).
void