Java 如何为自己的聊天客户端实现 XMPP 协议?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18096042/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 22:20:49  来源:igfitidea点击:

How can I implement XMPP protocol for my own chat client?

javaapixmppchat

提问by Suhail Gupta

I want to write a chat client. I could use RMI for that but I don't want to. Moreover I plan to have a web-interface.

我想写一个聊天客户端。我可以为此使用 RMI,但我不想。此外,我计划有一个网络界面。

I was reading about XMPP protocol and also the fact that google talkuses it. How can I implement it to write my own chat client, not a client for any other IM service? Is there any library available that could help me implement my own chat service (IM)?

我正在阅读有关 XMPP 协议以及google talk使用它的事实。我如何实现它来编写我自己的聊天客户端,而不是任何其他 IM 服务的客户端?是否有任何可用的库可以帮助我实现自己的聊天服务(IM)

采纳答案by Santosh

Check out Smack. Its widely used and mature library for writing xmpp application. Here is an exampleof writing xmpp client. Here is one more example.

查看Smack。其广泛使用且成熟的库,用于编写 xmpp 应用程序。下面是一个编写 xmpp 客户端的例子。这里还有一个例子

回答by amrinder007

There are many libraries available on the xmpp site iteself. You can choose anyone based on your requirement XMPP LibrariesGo for SMACKif you are writing your IM in JAVA.

xmpp 站点本身有许多可用的库。如果您使用 JAVA 编写 IM,您可以根据您的要求选择任何人XMPP LibrariesGo for SMACK