尝试连接时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)
这可能是什么原因?
Note:我已经允许openfire fire server通过防火墙。我也尝试关闭防火墙,但结果相同。服务器是我自己的机器。我试图在同一台机器上运行该程序。
您可以使用
Connection connection = new XMPPConnection("192.168.0.101");
connection.connect();
或者如果您想指定端口
ConnectionConfiguration config = new ConnectionConfiguration("192.168.0.101", 5222);
Connection connection = new XMPPConnection(config);
connection.connect();
或类似的,默认端口 5222
ConnectionConfiguration config = new ConnectionConfiguration("192.168.0.101");
Connection connection = new XMPPConnection(config);
connection.connect();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)