use the [CODE] tags - it makes it much easier for people to help you.
Originally posted by saager mhatre:
There seems to be a lack of clarity in your understanding of TCP\IP communication.
The server starts up a given system by locking a specific port, in your case port 80, and proceeds to listen to sockets on the wanting to transmit on that port.
The client comminicates/transmits to the server by connecting to it on that very port, i.e. the client sends a message to the server's IP on the port that the server is listening so that the server may hear it!
use the [CODE] tags - it makes it much easier for people to help you.
If everything goes well, the server accepts the connection. Upon acceptance, the server gets a new socket bound to a different port. It needs a new socket (and consequently a different port number) so that it can continue to listen to the original socket for connection requests while tending to the needs of the connected client.