首页 > 代码库 > smack

smack

XMPP/Smack/Openfire javax.net.ssl.SSLException: Received fatal alert: internal_error

解决:

1、在链接openfire服务器后,线程休眠一段时间,再进行登录login操作。

connection.connect(); 
Thread.sleep(3000);

connection.login(user, pass);

2、设置setPacketReplyTimeout参数

SmackConfiguration.setPacketReplyTimeout(PACKET_REPLY_TIMEOUT); 

config = new ConnectionConfiguration(SERVER, PORT);

注意:如果设置了休眠时间或setPacketReplyTimeout参数后还是出现错误,请讲时间设置再大些看看