|
@@ -95,6 +95,8 @@ ComontAlretViewControllerDelegate>
|
|
|
CIContext *videoContext;
|
|
|
|
|
|
NSInteger reConnectAccount;/*记录重连次数*/
|
|
|
+ NSInteger preTryAginTime;//上次重连时间戳
|
|
|
+ ConnectState RCLiveSteamlinkState;//视频流的链接状态
|
|
|
|
|
|
BOOL isInPan;/*标记是否有手指在活动*/
|
|
|
|
|
@@ -1186,6 +1188,8 @@ ComontAlretViewControllerDelegate>
|
|
|
HLog(@"\n------状态回调---state = %d--", state);
|
|
|
//[[VclCrash sharedInstance] writeContent:[NSString stringWithFormat:@"_connectDisconnect连接返回句柄 = %d--state--=%d-",ihandle,state]];
|
|
|
|
|
|
+ RCLiveSteamlinkState = state;
|
|
|
+
|
|
|
switch (state){
|
|
|
case 0:/*连接已释放*/{
|
|
|
}
|
|
@@ -2289,13 +2293,11 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
BOOL inReconnect = NO;
|
|
|
- (void)tryAgain
|
|
|
{
|
|
|
- reConnectAccount++;
|
|
|
-
|
|
|
|
|
|
HLog(@"yyyyyyyyyyyyy 重连次数 %ld ",reConnectAccount);
|
|
|
|
|
|
//20231017 修改后台3分钟再次进入 不断转圈圈问题
|
|
|
- if (reConnectAccount >0 && reConnectAccount == 50 )
|
|
|
+ if (reConnectAccount >0 && reConnectAccount == 10 )
|
|
|
{
|
|
|
mainBlock(^{
|
|
|
|
|
@@ -2316,6 +2318,21 @@ BOOL inReconnect = NO;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ //hxd add 每次重新连接时间 要间隔3秒
|
|
|
+ NSInteger curTryAginTime = [iTools getNowTimeStamp];
|
|
|
+ if(preTryAginTime > 0
|
|
|
+ && (curTryAginTime - preTryAginTime < 3)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(RCLiveSteamlinkState == ConnectStateConnected){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ preTryAginTime = curTryAginTime;
|
|
|
+
|
|
|
+ reConnectAccount++;
|
|
|
+
|
|
|
if(linkFailAlretVC && linkFailAlretVC.view.tag == 2){
|
|
|
[self WebSocketNeedRelinkFun];//hxd add 20240229
|
|
|
}
|
|
@@ -3005,6 +3022,8 @@ static int couneeee = 0;
|
|
|
HLog(@"云手机30s 无渲染数据 自动断开连接");
|
|
|
self.concentTime = [iTools getNowTimeStamp];
|
|
|
|
|
|
+ //这个赋值不是真的链接中 应该是失联了
|
|
|
+ RCLiveSteamlinkState = ConnectStateConnecting;
|
|
|
[self showNewIndicator];
|
|
|
[self tryAgain];
|
|
|
}
|