ServerSockets
We may also wish to have a process listening on a port for incoming
calls. Perhaps we’ve written a web browser that stands ready to send HTML content when a connection is made.
The ServerSocket class allows us to capture incoming calls.
ServerSocket outSock = new ServerSocket (6000);
Socket inSock = outSock.accept();
handleConnection(inSock);