摄像头分享和切换网络时重连

This commit is contained in:
kai60
2020-05-18 17:37:54 +08:00
parent aff0f33ec6
commit 52e644f3ab
3 changed files with 17 additions and 4 deletions
@@ -83,10 +83,23 @@
[super viewDidLoad];
[self setup];
[self connect];
[self networknotify];
// Do any additional setup after loading the view from its nib.
}
-(void)networknotify
{
AFNetworkReachabilityManager*networkManager=[AFNetworkReachabilityManager sharedManager];
[networkManager startMonitoring];
[networkManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
if (![Socketsingleton sharedInstance].clientSocket.isConnected)
{
[[Socketsingleton sharedInstance] cutOffSocket];
[self InitSocket];
}
}];
}
- (void)setup{
self.title = self.currentDevice.showName;
//右侧菜单