聊天通常是如何实现的?

发布于 2024-10-06 18:27:23 字数 208 浏览 0 评论 0原文

考虑一下您想要在计算机之间来回发送文本的情况。 (这可以是一对一对话或一对多对话。计算机也可以包括智能手机。)

通常如何创建此对话? 例如,您是否通过将所有各方都设置为接受请求的轻量级服务器来推送消息? (我对这个推动部分特别困惑。)

实践中使用了哪些特定的软件、协议和/或框架。

Consider the case in which you want to send text back and forth between computers. (This could be a 1-to-1 conversation or a 1-to-many conversation. Computers could also include smartphones.)

How may one create this in general?
For instance, do you push messages by making all parties into lightweight servers that take requests? (I'm particularly confused about this pushing part.)

What specific software, protocols, and/or frameworks are used in practice.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

豆芽 2024-10-13 18:27:23

使用 Comet 是很常见的(参见 http://en.wikipedia.org/wiki/Comet_ (编程))通过服务器,例如 Twisted。有关更深入的讨论,请参阅选择和部署 comet 服务器

其他选项包括使用 RTFMP 使用服务器,例如 Red5

It is common to employ comet (see http://en.wikipedia.org/wiki/Comet_(programming)) via a server such as Twisted. See Choosing and deploying a comet server for a more indepth discussion.

Other options include using RTFMP using a server such as Red5

撩动你心 2024-10-13 18:27:23

XMPP 是一种广泛使用的用于实现聊天功能的协议,因此您可能想要更深入地研究它。 IRC 是另一个,所以请继续阅读。

除此之外,通常有两种方法通过 HTTP 实现聊天:长轮询 和 AJAX轮询(每秒左右)。

下一个可以简化实施并减少带宽的“大”事物是网络套接字

例如,Facebook 的聊天是在 Erlang 中实现的。

如您所见,有许多技术、框架和语言可用于聊天实现,因此您必须进行一些研究并选择您认为最适合您的技术、框架和语言。

XMPP is a widely used protocol for implementing chat functionality, so you might want do dig deeper into it. IRC is another one, so read on it.

Aside from that, there are usually two ways to implement chat via HTTP: Long polling and AJAX polling (every second or so).

The next "big" thing that could simplify implementation and reduce bandwidth are web sockets.

Facebook's chat is implemented in Erlang, for example.

As you see, there are many technologies, frameworks and languages available for chat implementation, so you'll have to do some research and choose what you think is the best bet for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文