 | Useful for Client/Server TCP Socket programming |
 | Usual Steps on the Client
- Open a socket
- Open an input stream and output stream to the
socket
- Read from and write to the stream according to
the server's protocol
- Close the streams
- Close the socket
|
 | Usual Steps on the Server
- Open the server's socket
- Open an output stream to the server's socket
- Wait for a client to connect
 | When successfully connected, keep
track of the returned client socket |
 | Open an input stream to the client
socket
|
Read from the server's socket and write to the
client's socket according to server protocol
When the client disconnects
 | Close the client stream and socket |
Close the server's stream and socket
|