Facebook聊天如何进行? [英] How Facebook chat is working?

查看:438
本文介绍了Facebook聊天如何进行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook聊天如何进行?谁能给我个主意?我的意思是他们使用的是websocket还是AJAX?他们是如何实现的?

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

推荐答案

这是彗星(参见Wikipedia)模型:

Comet是一种Web应用程序模型,其中长时间存在的HTTP请求 允许Web服务器将数据推送到浏览器,而无需浏览器 明确要求.彗星是一个总括性术语,涵盖 实现这种交互的多种技术.所有这些方法 依赖于浏览器默认包含的功能,例如JavaScript, 而不是使用非默认插件.彗星的方法不同于 网络的原始模型,浏览器在其中请求完整的 网页一次.

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.

彗星框架的示例是 APE .它用于javascript,但是彗星不仅可以用javascript编写.

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

这篇关于Facebook聊天如何进行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆