我们使用 smack 库来建立到 GCM 的 XMPP 连接。我已经在应用程序上有很多连接,我们已经实现了 Smack 库的 ConnectionListener 类。所以我们使用以下方法。
@Override
public void connectionClosedOnError(Exception e) {
logger.error(e, "connectionListener::connectionClosedOnError::appKey::{}::clientId::{}", appKey, clientId);
}
这个实现已经工作了很长时间。但是最近 2 天我们遇到了这样的错误;
05:16:50,846 ERROR [CcsClient ] -
connectionListener::connectionClosedOnError
::appKey::xxx::clientId::xxxx
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
at sun.security.ssl.InputRecord.read(InputRecord.java:480)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934)
at sun.security.ssl.SSLSocketImpl.
readDataRecord(SSLSocketImpl.java:891)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:154)
at java.io.BufferedReader.read1(BufferedReader.java:205)
at java.io.BufferedReader.read(BufferedReader.java:279)
at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:2992)
at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
at org.jivesoftware.smack.PacketReader.
parsePackets(PacketReader.java:312)
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:48)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)
这是什么原因?
www说
相关分类