The java.net.ServerSocket Class
The java.net.ServerSocket class represents a server socket.
A ServerSocket object is constructed on a particular local port. Then it calls accept() to listen for incoming connections.
accept() blocks until a connection is detected. Then accept() returns a java.net.Socket object you use to perform the actual communication with the client.