浏览代码

1.瑞云修改点击重连后没有请求到他们那边---修改方案是重新创建新的http 端口
2.挤下线再次要发3次

huangxiaodong 1 年之前
父节点
当前提交
f4e31a76fa

+ 6 - 1
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.mm

@@ -1514,6 +1514,11 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
     {
         if (result < 0)
         {
+            if(result == -5){
+                [[connectDeviceManager shareInstance]   recreateHttpServiceFun];
+                //睡一下 等瑞云处理完 继续tryAgain
+                sleep(1);
+            }
             [self tryAgain];
         }
         else if (result == 12)
@@ -1786,7 +1791,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
         NSString *commondStr  = @"{\"type\":\"forwardMsg\",\"data\":\"offline_notification\"}";
         [self send_data:commondStr];
         
-        //[self addCommandSendTaskFunWithType:@"offline_notification" WithCommandStr:commondStr];
+        [self addCommandSendTaskFunWithType:@"offline_notification" WithCommandStr:commondStr];
         
         _didSendfristMsg = true;
         

+ 2 - 0
创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.h

@@ -47,6 +47,8 @@ typedef void (^netWork_DidEndByOK) (NSInteger didSuc); // 0 fail 1 suc -1 处理
 -(void)updateCardInfoBySN:(NSString*)snStr withPwdStr:(NSString*)pwd didNetEnd:(netWork_DidEndByOK)didNetEndIsOK;
 
 - (void)tryReconnectFun;
+//音视频 链接返回-5的时候调用
+- (void)recreateHttpServiceFun;
 @end
 
 NS_ASSUME_NONNULL_END

+ 9 - 0
创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.m

@@ -413,6 +413,15 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
     
 }
 
+//音视频 链接返回-5的时候调用
+- (void)recreateHttpServiceFun{
+    [cachesFileManager writeLogsWithMsg:@"recreateHttpServiceFun"];
+    NSString *sdnId = self.DeviceThirdIdMod.data.sdnId;
+    [RaylinkProxy.sharedManager closeHttpService:sdnId];
+    self.tcpPort = [RaylinkProxy.sharedManager createHttpService:sdnId];
+    self.tcpPortStr = [[NSString alloc] initWithFormat:@"%ld",self.tcpPort];
+}
+
 //- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port {
 //
 //    NSLog(@"didConnectToHost %d", port);