fix bug of AISDK about socket
This commit is contained in:
@@ -182,6 +182,7 @@ public class SocketManager implements IMogoCloudSocketManager {
|
||||
|
||||
public synchronized void release() {
|
||||
mListeners.clear();
|
||||
mAckListeners.clear();
|
||||
if (cloudClientConfig.isThirdLogin()) {
|
||||
ThirdSocketManager.getInstance().release();
|
||||
} else {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user