How Facebook chat is working? Can anyone give me idea? I mean they are using websocket or AJAX? How they have implemented it?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With