【发布时间】:2026-02-10 14:55:01
【问题描述】:
在尝试通过以下代码连接到 openfire 服务器时:
Connection connection = new XMPPConnection("https://192.168.0.101:5222");
connection.connect();
我得到一个例外,上面写着:
https://192.168.0.101:5222:5222 Exception: Could not connect
to https://192.168.0.101:5222:5222.; : remote-server-timeout(504)
这可能是什么原因?
注意:我已经允许openfire fire服务器通过防火墙。我也尝试关闭防火墙,但结果相同。服务器是我自己的机器。我正在尝试运行程序的同一台机器。
【问题讨论】:
-
您的网络是否正常工作...已在代码中检查...
-
@karan421 123 123..是的,它正在工作
-
ping ip 地址并查看响应时间并查看使用wireshark 会发生什么
-
@SuhailGupta 你不需要输入端口。
new XMPPConnection("192.168.0.101")很好 -
你正在使用哪个操作系统