Developing a mobile chat room, backend use XMPP or WebSocket?

我们两清 提交于 2019-12-31 05:07:34

问题


Some requirements for a mobile chat room:

  1. Should be able to work seamlessly with client's frequent connect/disconnect due to the mobile network

  2. Bandwidth saving (less overhead)

I don't have experience in XMPP, I only have worked with Node.JS server and it is easy to setup and hack the server with JavaScript.

But seems XMPP is the defacto standard for chat room, e.g. WhatsApp use them., anyone can share your experience in these two technologies?


回答1:


You are kind of asking how can I get to my destination, should I drive my car, or take the railroad tracks. If you go with the railroad tracks, you still have to build your train.

XMPP is primarily used for chat and excels in that space. Websockets is much more similar to BOSH in XMPP, an extension to allow two way communications over HTTP. Websockets is just a connection protocol, as opposed to a realtime messaging protocol that actually supports the concept of chat. I would speculate that in the future, there will an extension added to XMPP to support Websockets, as it is a natural fit.

Not saying that you can't use Websockets, just that you will still have to build the 'chat' protocol on top of it, as opposed to using an existing one with many servers readily available.



来源:https://stackoverflow.com/questions/11131760/developing-a-mobile-chat-room-backend-use-xmpp-or-websocket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!