如标题所示,今天晚上突然所有客户端都无法使用即时通讯功能,调试了下代码发现代码没有执行开启实时聊天的回调,代码片如下:
public void open(final String userId, String tag, final AVIMClientCallback callback) {
if (TextUtils.isEmpty(userId)) {
throw new IllegalArgumentException("userId can not be empty!");
}
if (null == callback) {
throw new IllegalArgumentException("callback can not be null!");
}
AVIMClientCallback openCallback = new AVIMClientCallback() {
@Override
public void done(final AVIMClient avimClient, AVIMException e) {
if (null == e) {
currentUserId = userId;
LCIMProfileCache.getInstance().initDB(AVOSCloud.applicationContext, userId);
LCIMConversationItemCache.getInstance().initDB(AVOSCloud.applicationContext, userId, new AVCallback() {
@Override
protected void internalDone0(Object o, AVException e) {
callback.internalDone(avimClient, e);
}
});
} else {
callback.internalDone(avimClient, e);
}
}
};
if (AVUtils.isBlankContent(tag)) {
AVIMClient.getInstance(userId).open(openCallback);
} else {
AVIMClient.getInstance(userId, tag).open(openCallback);
}
}
同时Logcat有异常日志:E/===AVOS Cloud===: LogUtil$avlog->e->49: null
error:java.net.SocketTimeoutException: timeout,请技术人员尽快处理