gpt4 book ai didi

java - 如何实现Smack 4.1.0,ConnectionConfiguration.Builder类?

转载 作者:行者123 更新时间:2023-12-01 07:57:36 25 4
gpt4 key购买 nike

smack 4.1.0库有变化,有人可以告诉我如何实现ConnectionConfiguration.Builder<B extends ConnectionConfiguration.Builder<B,C>,C >类?

最佳答案

如果您通过 TCP 连接到服务器,则可以使用 XMPPTCPConnectionConfiguration 类。示例代码:

XMPPTCPConnectionConfiguration conf = XMPPConnectionConfiguration
.builder()
.setServiceName("example.org");
.setHost("xmpp1.example.org")
.setPort(Port)
.setUsernameAndPassword("user", "password")
.setCompressionEnabled(false)
.build();

XMPPTCPConnection connection = new XMPPTCPConnection(conf);

来源:https://www.igniterealtime.org/builds/smack/docs/4.1.3/javadoc/org/jivesoftware/smack/ConnectionConfiguration.Builder.html

关于java - 如何实现Smack 4.1.0,ConnectionConfiguration.Builder类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28074490/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com