I'm using yahoo messenger to chat with my friends. Every time a friend of mine comes online (almost intermediately) YM will notify me. How did Yahoo! (and other companies) do to implement this? As far as I guess, there are some techniques to solve this issue:
Pulling: client constantly (500ms duration, maybe) asks server about which users (in the user's list) has just come online and then notify user.
Pushing: server determines which users come online and then send a notify to client.
The second approach is much more acceptable. The data of user may contain a list of his friend (who added him to their lists), and the login event raises, server app will send a notify message to all users in this list.
OK, this is only my guess. How was it implemented in reality? Can you tell me?
Thank you.
Possibly long lived HTTP requests. The IM client calls to a HTTP method on the server but the server doesn't respond until there is an update. At that point it responds with "update" and the IM client then calls another HTTP method to get the update.
Real push isn't possible because many (most?) people on the Internet are behind NAT routers.