Tuesday, January 27, 2009

Putting it together...

I have been using word pictures to try and help you understand the internet terms. This post will be the culmination of them all. First, a little refresher:

An IP is like your computer's address
A port is like a door
A TCP connection is like a mail system
A packet is like a piece of mail.
A socket is a combination of both an IP and a port

So first, your server will open up a door(port) next your client will open a door(port) Then the client will attempt to 'mail' (Send using TCP) a piece of information(a packet) to the server's 'house'(IP address) and in the open door(port) the combination of the house and door is a socket.

That is the basic gist of online communications. You will be sending packets back and forth between a server and a client. These packets can contain many things from a player's x and y position to a chat message.

No comments:

Post a Comment