server implementation
The server is the program that starts first and waits for incoming connections. Implementing a server consists of six basic steps:
Create a ServerSocket object.
Create a Socket object from the ServerSocket.
Create an input stream to read input from the client.
Create an output stream that can be used to send information back to the client.
Do I/O with input and output streams.
Close the Socket when done.