fix bug of AISDK about socket

This commit is contained in:
zhongchao
2021-03-10 12:13:44 +08:00
parent 5a2f7e3af9
commit 75d877fedf
6 changed files with 29 additions and 87 deletions

View File

@@ -182,6 +182,7 @@ public class SocketManager implements IMogoCloudSocketManager {
public synchronized void release() {
mListeners.clear();
mAckListeners.clear();
if (cloudClientConfig.isThirdLogin()) {
ThirdSocketManager.getInstance().release();
} else {

View File

@@ -74,6 +74,8 @@ public class InternalSocketManager implements OnSocketReceiveCallback, OnSocketA
public void release() {
if (mSocketConnManager != null) {
mSocketConnManager.rmSocketMessageCallback(this);
mSocketConnManager.rmSocketAckCallback(this);
mSocketConnManager.onRelease();
mSocketConnManager = null;
}

View File

@@ -50,6 +50,7 @@ public class ThirdSocketManager implements Callback {
.setToken(cloudClientConfig.getToken())
.setAuthPubKey(cloudClientConfig.getAuthPubKey())
.setDebug(cloudClientConfig.isShowDebugLog());
SocketClient.getInstance().registerSocketCallback(this);
SocketClient.getInstance().start(context);
}
@@ -75,6 +76,7 @@ public class ThirdSocketManager implements Callback {
}
public synchronized void release() {
SocketClient.getInstance().unregisterSocketCallback(this);
SocketClient.getInstance().stop();
mInstance = null;
}