摄像头分享和切换网络时重连
This commit is contained in:
+14
-1
@@ -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;
|
||||
//右侧菜单
|
||||
|
||||
Reference in New Issue
Block a user