Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Facebook chat is working?

Tags:

php

facebook

How Facebook chat is working? Can anyone give me idea? I mean they are using websocket or AJAX? How they have implemented it?

like image 486
Jimit Avatar asked Sep 21 '11 07:09

Jimit


People also ask

What is the difference between FB chat and Messenger?

Both communication channels offer instant communication with one difference. In live chats, you have to present during the chat. On the other hand, you can send a message to a customer in Messenger and then back to them later.

How does Facebook Chat decide which friends to show?

Your chat sidebar works in a similar way. The algorithm chooses interactions, activity, communication, photos, etc. This determines which friends will show up on top and have priority. The friends that you communicate with most often will usually be first on this list.

Can you tell if someone is checking your Messenger?

A filled-in blue circle next to your message means that your message was delivered. And, when a friend has read your message, a small version of your friend's photo will appear next to your message.

What happens if you message someone you're not friends with on Facebook?

You can send messages to anyone on Facebook. Messages you send to people you're not friends with may arrive in their Message Requests folder. Your messages also won't reach people who may have blocked you on Facebook chat or Messenger.


1 Answers

It's a comet (see wikipedia) model:

Comet is a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it. Comet is an umbrella term, encompassing multiple techniques for achieving this interaction. All these methods rely on features included by default in browsers, such as JavaScript, rather than on non-default plugins. The Comet approach differs from the original model of the web, in which a browser requests a complete web page at a time.

Example of comet framework is APE. It is for javascript, however comet can be written not only in javascript.

like image 63
pmaruszczyk Avatar answered Oct 12 '22 23:10

pmaruszczyk