From add3b8e0b093db76ff72967de5094ca89d4f0bab Mon Sep 17 00:00:00 2001 From: kai Date: Tue, 31 Aug 2021 22:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=87=8D=E8=BF=9E5=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IfishP2PMonitorController.m | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m index 2c53c02..cf34afc 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m @@ -111,6 +111,9 @@ Strong MessageAlertView *popView; @property(nonatomic,strong) ELPCircleConsoleView *directionView; Weak UIView *remoteView;//显示player的载体 Strong UIImage *screenShotImage;//截图 +//自动重试次数 5次 +@property (assign, nonatomic) NSInteger retryTime; + @end extern BOOL formLogIn;//连接页面是否来自登录界面 BOOL isfromCameraView;//未绑定鱼缸时,去绑定鱼缸 判断是否从摄像头界面进入 @@ -353,13 +356,23 @@ Strong UIImage *screenShotImage;//截图 NSLog(@"[p2pCallDevice-Accept],paras=%@",parameters); } reject:^(GWP2PCallError error, NSString *errorCode) { - _isReject=YES; - NSLog(@"摄像头连接失败"); - dispatch_async(dispatch_get_main_queue(), ^{ - [self.view hideToast]; - [self.view makeToast:@"连接失败"]; - [self hiddenMonitoringUI:NO callWithErrorType:(NSInteger)error isReCall:NO]; - }); + if (error==GWP2PCallErrorTimeout&&self.retryTime<5) + { + self.retryTime++; + [self monitorP2PCall]; + return; + } + else + { + _isReject=YES; + NSLog(@"摄像头连接失败"); + dispatch_async(dispatch_get_main_queue(), ^{ + [self.view hideToast]; + [self.view makeToast:@"连接失败"]; + [self hiddenMonitoringUI:NO callWithErrorType:(NSInteger)error isReCall:NO]; + }); + + } } ready:^{