Thread: IM Basics
View Single Post
Old Dec 22nd, 2006, 4:31 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Different IM programs work in different ways, so it's difficult to answer this question with any detail.

But I can provide generalities. Say Bob decides to IM Carol with the message "Hello". The first step is that the IM client encodes the username and message together, ("Carol", "Hello"). Then it sends that packet off to a central server.

The server receives the data, and checks the username part ("Carol"). It checks through a table to see if Carol is currently connected to the server. If she is, then the server replaces the username part with the sender ("Bob"), and pushes it down Carol's IM connection.

Carol receives ("Bob", "Hello"), and this is rendered on screen as "Bob: Hello". That's basically all IM does, though things can get more complex. For more detail in a specific protocol, try Googling for some specs for "Jabber" or "XMPP".
Arevos is offline   Reply With Quote