|
|
@@ -63,22 +63,23 @@ static webSocketManager *webSocketManagerInstance = nil;
|
|
|
{
|
|
|
if(self.commandChannelManager){
|
|
|
|
|
|
- if([self.commandChannelManager rc_socketStatus] == RCSocketCloudPhoneStatusConnected
|
|
|
- ||[self.commandChannelManager rc_socketStatus] == RCSocketCloudPhoneStatusReceived){
|
|
|
- //链接中不处理
|
|
|
- HLog(@"WebSocket 链接时已经存在并且链接中");
|
|
|
+ RCSocketCloudPhoneStatus status = [self.commandChannelManager rc_socketStatus];
|
|
|
+ //HLog(@"rc_socketStatus:%ld",status)
|
|
|
+ if(status == RCSocketCloudPhoneStatusFailed
|
|
|
+ ||status == RCSocketCloudPhoneStatusClosedByServer
|
|
|
+ ||status == RCSocketCloudPhoneStatusClosedByUser
|
|
|
+ ||!ksharedAppDelegate.isWebSockLinkOKAginType//断开了
|
|
|
+ )
|
|
|
+ {
|
|
|
+ HLog(@"WebSocket 链接时已经存在并且链接失效:%ld",status);
|
|
|
+ [self.commandChannelManager rc_close];
|
|
|
+ self.commandChannelManager = nil;
|
|
|
}
|
|
|
else{
|
|
|
- HLog(@"WebSocket 链接时已经存在并且链接失效");
|
|
|
- [self.commandChannelManager rc_close];
|
|
|
-
|
|
|
- self.commandChannelManager = nil;
|
|
|
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
- [self opencommandChannelManagerrc_openURL];
|
|
|
- });
|
|
|
+ HLog(@"WebSocket 链接时已经存在并且链接中:%ld",status);
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
- return;
|
|
|
}
|
|
|
|
|
|
KWeakSelf
|
|
|
@@ -380,15 +381,22 @@ static webSocketManager *webSocketManagerInstance = nil;
|
|
|
|
|
|
- (void)checkAllTaskFun
|
|
|
{
|
|
|
- if([self.commandChannelManager rc_socketStatus] == RCSocketCloudPhoneStatusConnected
|
|
|
- ||[self.commandChannelManager rc_socketStatus] == RCSocketCloudPhoneStatusReceived){
|
|
|
- HLog(@"WebSocket 链接正常");
|
|
|
+ RCSocketCloudPhoneStatus status = [self.commandChannelManager rc_socketStatus];
|
|
|
+ //HLog(@"rc_socketStatus:%ld",status)
|
|
|
+ if(status == RCSocketCloudPhoneStatusFailed
|
|
|
+ ||status == RCSocketCloudPhoneStatusClosedByServer
|
|
|
+ ||status == RCSocketCloudPhoneStatusClosedByUser
|
|
|
+ ||!ksharedAppDelegate.isWebSockLinkOKAginType//断开了
|
|
|
+ )
|
|
|
+ {
|
|
|
+ HLog(@"WebSocket 链接异常:%ld",status);
|
|
|
+ return;
|
|
|
}
|
|
|
else{
|
|
|
- HLog(@"WebSocket 链接异常:%ld",[self.commandChannelManager rc_socketStatus]);
|
|
|
- return;
|
|
|
+ HLog(@"WebSocket 链接正常:%ld",status);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//处理相册备份
|
|
|
[[backupsFileManager shareInstance] checkReBackupsFileFun];
|
|
|
|