Socket连接和XMPP连接的区别
我对这两种联系很陌生。我以前使用过 HTTP 连接,现在我想转向一种新的连接类型。我搜索了连接并得到了这两种类型:Socket Connection 和 XMPP Connection。它们之间的主要区别是什么?我想将其用于聊天应用程序,那么推荐哪种类型更好?谢谢
I am new to these two connections. I used to work with HTTP Connection before and now I wanna move to a new type of connection. I searched about connections and got these two types: Socket Connection and XMPP Connection. What is the main difference between them? I wanna use this for a chat application so which type is better recommended? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
XMPP 是一种通信协议,HTTP 也是一种通信协议。 XMPP 和 HTTP 都将在内部使用套接字连接。
您对应用程序协议和网络层感到困惑。
XMPP is a protocol for communication and so is HTTP. Both XMPP and HTTP will internally use socket connections.
You are confused between application protocols and network layer.
套接字是任何现有连接的本质。如果您想使用任何具有主机点和端口的连接,很可能(除非他们自己编写),他们使用 Socket(在给定端口上打开连接,发送消息,并关闭内部连接端口)。
Socket is the essential thing of any existing connections there is. If you want to use any connection that has a host point and a port, very likely (unless they write their own), they use
Socket
(to open a connection on a given port, send a message, and close the connection port) internally.