Sockets for Servers
The difference between client sockets and server sockets
is that the server sockets wait for an incoming connection.
The basic life cycle of a server is:
- 1. A new ServerSocket is created
- 2. The socket listens for incoming connections using the accept call which blocks.
- 3.The server interacts with the client
- 4.The client and/or server closes the socket
- 5.The server returns to step 2.