Echo client, preliminary

First you will have to know a few basics. Servers are actually programs that "listen to ports". A port is a integer, since the server is listening to it, a client can send a request to connect with it. once you have connected to it, there is a line open for communications between the two programs (Server/Client). The socket contains both an output stream and an inputstream, untill it is closed.
You can think about a socket connection as a telephone call. When you dial you send a request to the recipient to connect to you (connection request). If the person you wish to talk too is at home and hears the phone, he/she may pick up the phone (connection accepted), or they can ignore you if they are home or they may be away (connection refused).
When either one of the persons in the conversation hangs up the phone, the connection is closed. There will be no sense in keeping the connection up, so the other one hangs up and closes his/her connection.

Now onto the  tutorial

Ps.
I any experienced programmers finds this explenation about sockets silly and/or lousy. Please let me know at  per_westvik@hotmail.com