优化连接过程
This commit is contained in:
parent
ff26073344
commit
d0e290bea6
|
|
@ -37,6 +37,28 @@
|
||||||
}
|
}
|
||||||
[IFishHotpotUDPHelper sharedInstance].delegate = self;
|
[IFishHotpotUDPHelper sharedInstance].delegate = self;
|
||||||
[[IFishHotpotUDPHelper sharedInstance] broadCastRestCommand];
|
[[IFishHotpotUDPHelper sharedInstance] broadCastRestCommand];
|
||||||
|
|
||||||
|
__weak typeof(self) weakSelf = self;
|
||||||
|
[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
|
||||||
|
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||||
|
BOOL networkOk = NO;
|
||||||
|
if (status == AFNetworkReachabilityStatusReachableViaWiFi) {
|
||||||
|
if (![[strongSelf currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) {
|
||||||
|
networkOk = YES;
|
||||||
|
}
|
||||||
|
} else if (status == AFNetworkReachabilityStatusReachableViaWWAN) {
|
||||||
|
networkOk = YES;
|
||||||
|
}
|
||||||
|
if (!networkOk) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (strongSelf.isDeleteingDevice) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
strongSelf.isDeleteingDevice = YES;
|
||||||
|
[strongSelf deletDevice];
|
||||||
|
}];
|
||||||
|
[[AFNetworkReachabilityManager sharedManager] startMonitoring];
|
||||||
}
|
}
|
||||||
- (IBAction)tipBtnClicked:(id)sender {
|
- (IBAction)tipBtnClicked:(id)sender {
|
||||||
ConnectHotspotTipViewController *vc = [[ConnectHotspotTipViewController alloc] initWithNibName:nil bundle:nil];
|
ConnectHotspotTipViewController *vc = [[ConnectHotspotTipViewController alloc] initWithNibName:nil bundle:nil];
|
||||||
|
|
@ -46,39 +68,14 @@
|
||||||
#pragma mark - IFishHotpotUDPHelperDelegate
|
#pragma mark - IFishHotpotUDPHelperDelegate
|
||||||
|
|
||||||
- (void)udpHelperCommandExecutedSuccess:(IFishUDPHelperBackMsgModel *)backModel {
|
- (void)udpHelperCommandExecutedSuccess:(IFishUDPHelperBackMsgModel *)backModel {
|
||||||
self.HUD.labelText = @"设备即将重置";
|
self.HUD.labelText = @"设备正在恢复出厂设置";
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
NSArray*deviceArry=[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
|
||||||
NSArray*deviceArry=[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
|
[deviceArry enumerateObjectsUsingBlock:^(DeviceModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
[deviceArry enumerateObjectsUsingBlock:^(DeviceModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
if ([obj.macAddress isEqualToString:backModel.senderMacAddress]) {
|
||||||
if ([obj.macAddress isEqualToString:backModel.senderMacAddress]) {
|
self.currentDevice = obj;
|
||||||
self.currentDevice = obj;
|
*stop = YES;
|
||||||
self.HUD.labelText = @"请切当前Ifish-xxxx到其他网络,以进行后续操作";
|
}
|
||||||
*stop = YES;
|
}];
|
||||||
}
|
|
||||||
}];
|
|
||||||
|
|
||||||
[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
|
|
||||||
BOOL networkOk = NO;
|
|
||||||
if (status == AFNetworkReachabilityStatusReachableViaWiFi) {
|
|
||||||
if (![[self currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) {
|
|
||||||
networkOk = YES;
|
|
||||||
}
|
|
||||||
} else if (status == AFNetworkReachabilityStatusReachableViaWWAN) {
|
|
||||||
networkOk = YES;
|
|
||||||
}
|
|
||||||
if (!networkOk) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (self.isDeleteingDevice) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
self.isDeleteingDevice = YES;
|
|
||||||
[self deletDevice];
|
|
||||||
}];
|
|
||||||
[[AFNetworkReachabilityManager sharedManager] startMonitoring];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)udpHelperMessage:(NSString *)msg {
|
- (void)udpHelperMessage:(NSString *)msg {
|
||||||
|
|
@ -103,7 +100,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)deletDevice{
|
-(void)deletDevice{
|
||||||
self.HUD.labelText = @"开始删除设备";
|
self.HUD.labelText = @"正在删除设备";
|
||||||
//先判断此设备是否有关联 摄像头
|
//先判断此设备是否有关联 摄像头
|
||||||
//DeviceModel*deviceModel=[_deviceArr objectAtIndex:indexpath.row];
|
//DeviceModel*deviceModel=[_deviceArr objectAtIndex:indexpath.row];
|
||||||
//要删除的设设备id
|
//要删除的设设备id
|
||||||
|
|
@ -132,7 +129,7 @@
|
||||||
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
|
NSDictionary*resultDic=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
|
||||||
NSLog(@"result:%@",resultDic[@"result"]);
|
NSLog(@"result:%@",resultDic[@"result"]);
|
||||||
if ([resultDic[@"result"] isEqualToString:@"100"]) {
|
if ([resultDic[@"result"] isEqualToString:@"100"]) {
|
||||||
self.HUD.labelText = @"删除成功";
|
self.HUD.labelText = @"设备删除成功";
|
||||||
//重置数据库
|
//重置数据库
|
||||||
NSArray*deviceArry=[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
|
NSArray*deviceArry=[[DataCenter defaultDtacenter]valueForKey:@"deviceInfo"];
|
||||||
NSMutableArray *newArr = [NSMutableArray arrayWithArray:deviceArry];
|
NSMutableArray *newArr = [NSMutableArray arrayWithArray:deviceArry];
|
||||||
|
|
@ -143,8 +140,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[[DataCenter defaultDtacenter] setValue: newArr forKey:@"deviceInfo"];
|
[[DataCenter defaultDtacenter] setValue: newArr forKey:@"deviceInfo"];
|
||||||
|
[self.navigationController popViewControllerAnimated:YES];
|
||||||
}else if ([resultDic[@"result"] isEqualToString:@"101"]){
|
}else if ([resultDic[@"result"] isEqualToString:@"101"]){
|
||||||
self.HUD.labelText = @"删除失败";
|
self.HUD.labelText = @"设备删除失败";
|
||||||
}else if ([resultDic[@"result"] isEqualToString:@"301"]){
|
}else if ([resultDic[@"result"] isEqualToString:@"301"]){
|
||||||
self.HUD.labelText = @"请求验证失败,请重新登陆";
|
self.HUD.labelText = @"请求验证失败,请重新登陆";
|
||||||
}else if ([resultDic[@"result"] isEqualToString:@"302"]){
|
}else if ([resultDic[@"result"] isEqualToString:@"302"]){
|
||||||
|
|
|
||||||
|
|
@ -158,20 +158,20 @@
|
||||||
|
|
||||||
- (void)udpHelperCommandExecutedSuccess:(IFishUDPHelperBackMsgModel *)backModel {
|
- (void)udpHelperCommandExecutedSuccess:(IFishUDPHelperBackMsgModel *)backModel {
|
||||||
self.ssid = backModel.senderMacAddress;
|
self.ssid = backModel.senderMacAddress;
|
||||||
|
[self.view resignFirstResponder];
|
||||||
self.HUD.labelText = @"请切当前Ifish-xxxx到其他网络,以进行后续操作";
|
self.HUD.labelText = @"请稍后";
|
||||||
self.trackString = [NSMutableString string];
|
self.trackString = [NSMutableString string];
|
||||||
[self appendTrakContent:@"=================收到设备答复==================="];
|
[self appendTrakContent:@"=================收到设备答复==================="];
|
||||||
[self appendTrakContent:[NSString stringWithFormat:@"答复状态码:%@", backModel.result]];
|
[self appendTrakContent:[NSString stringWithFormat:@"答复状态码:%@", backModel.result]];
|
||||||
[self appendTrakContent:[NSString stringWithFormat:@"答复Mac地址:%@", backModel.senderMacAddress]];
|
[self appendTrakContent:[NSString stringWithFormat:@"答复Mac地址:%@", backModel.senderMacAddress]];
|
||||||
[IFishHotpotUDPHelper sharedInstance].delegate = nil;
|
|
||||||
[[IFishHotpotUDPHelper sharedInstance] broadCastRestartCommand];
|
|
||||||
self.macAddress = backModel.senderMacAddress;
|
self.macAddress = backModel.senderMacAddress;
|
||||||
|
|
||||||
|
__weak typeof(self) weakSelf = self;
|
||||||
[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
|
[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
|
||||||
|
__strong typeof(weakSelf) strongSelf = weakSelf;
|
||||||
BOOL networkOk = NO;
|
BOOL networkOk = NO;
|
||||||
if (status == AFNetworkReachabilityStatusReachableViaWiFi) {
|
if (status == AFNetworkReachabilityStatusReachableViaWiFi) {
|
||||||
if (![[self currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) {
|
if (![[strongSelf currentWifiSSID].lowercaseString hasPrefix:@"ifish"]) {
|
||||||
networkOk = YES;
|
networkOk = YES;
|
||||||
}
|
}
|
||||||
} else if (status == AFNetworkReachabilityStatusReachableViaWWAN) {
|
} else if (status == AFNetworkReachabilityStatusReachableViaWWAN) {
|
||||||
|
|
@ -180,16 +180,19 @@
|
||||||
if (!networkOk) {
|
if (!networkOk) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (self.isBindingDevice) {
|
if (strongSelf.isBindingDevice) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (self.macAddress.length == 0) {
|
if (strongSelf.macAddress.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.isBindingDevice = YES;
|
strongSelf.isBindingDevice = YES;
|
||||||
[self bindDeviceWithSsid:self.macAddress];
|
[strongSelf bindDeviceWithSsid:self.macAddress];
|
||||||
}];
|
}];
|
||||||
[[AFNetworkReachabilityManager sharedManager] startMonitoring];
|
[[AFNetworkReachabilityManager sharedManager] startMonitoring];
|
||||||
|
|
||||||
|
[IFishHotpotUDPHelper sharedInstance].delegate = nil;
|
||||||
|
[[IFishHotpotUDPHelper sharedInstance] broadCastRestartCommand];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)udpHelperMessage:(NSString *)msg {
|
- (void)udpHelperMessage:(NSString *)msg {
|
||||||
|
|
@ -203,7 +206,7 @@
|
||||||
NSLog(@"设备bssid_%@",bssid);
|
NSLog(@"设备bssid_%@",bssid);
|
||||||
[self appendTrakContent:@"=================进入绑定函数================="];
|
[self appendTrakContent:@"=================进入绑定函数================="];
|
||||||
NSString *userId = [dataContorl dataControlGetUserIdInfo];
|
NSString *userId = [dataContorl dataControlGetUserIdInfo];
|
||||||
self.HUD.labelText = @"开始绑定设备";
|
self.HUD.labelText = @"正在绑定设备";
|
||||||
[self appendTrakContent:[NSString stringWithFormat:@"绑定参数 userID:%@", userId]];
|
[self appendTrakContent:[NSString stringWithFormat:@"绑定参数 userID:%@", userId]];
|
||||||
[self appendTrakContent:[NSString stringWithFormat:@"绑定参数 macaddress:%@", bssid]];
|
[self appendTrakContent:[NSString stringWithFormat:@"绑定参数 macaddress:%@", bssid]];
|
||||||
[AFHttpTool bindDeviceWithUserId:userId macAddress:bssid success:^(id response) {
|
[AFHttpTool bindDeviceWithUserId:userId macAddress:bssid success:^(id response) {
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,6 @@
|
||||||
NSString *_pwd;
|
NSString *_pwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property (nonatomic, assign) BOOL backMessageReceived;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -35,60 +33,55 @@
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
sharedInstace = [[self alloc] init];
|
sharedInstace = [[self alloc] init];
|
||||||
});
|
});
|
||||||
|
|
||||||
return sharedInstace;
|
return sharedInstace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (instancetype)init {
|
||||||
|
if (self = [super init]) {
|
||||||
|
self.clientSocket = [[AsyncUdpSocket alloc] initWithDelegate:self];
|
||||||
|
|
||||||
|
UInt16 bindPort = 9954;
|
||||||
|
|
||||||
|
NSError *error;
|
||||||
|
[self.clientSocket enableBroadcast:YES error:&error];
|
||||||
|
//本地接收端口
|
||||||
|
[self.clientSocket bindToPort:bindPort error:&error];
|
||||||
|
[self.clientSocket receiveWithTimeout:-1 tag:0];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)broadCastHotspotConnectCommandWith:(NSString *)ssidName pwd:(NSString *)pwd {
|
- (void)broadCastHotspotConnectCommandWith:(NSString *)ssidName pwd:(NSString *)pwd {
|
||||||
_ssidName = ssidName;
|
_ssidName = ssidName;
|
||||||
_pwd = pwd;
|
_pwd = pwd;
|
||||||
[self postmsg:@"命令已发出"];
|
[self postmsg:@"命令已发出"];
|
||||||
self.backMessageReceived = NO;
|
[self sendConnectHotspotSoketdata];
|
||||||
self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:K_ReSendTimeInterval target:self selector:@selector(sendConnectHotspotSoketdata) userInfo:nil repeats:YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)broadCastRestCommand {
|
- (void)broadCastRestCommand {
|
||||||
[self postmsg:@"命令已发出"];
|
[self postmsg:@"命令已发出"];
|
||||||
self.backMessageReceived = NO;
|
[self sendRestSocketData];
|
||||||
self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:K_ReSendTimeInterval target:self selector:@selector(sendRestSocketData) userInfo:nil repeats:YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)sendRestSocketData {
|
- (void)sendRestSocketData {
|
||||||
NSString* hostS = @"192.168.4.1";
|
NSString* hostS = @"192.168.4.1";
|
||||||
|
|
||||||
self.clientSocket = [[AsyncUdpSocket alloc] initWithDelegate:self];
|
|
||||||
//120.55.190.56 服务器IP 指令中用
|
|
||||||
ResetDeviceModel *model = [ResetDeviceModel new];
|
ResetDeviceModel *model = [ResetDeviceModel new];
|
||||||
NSString *request=[NSString stringWithFormat:@"%@", model.description];
|
NSString *request=[NSString stringWithFormat:@"%@", model.description];
|
||||||
|
|
||||||
NSData *data=[dataContorl stringToHexData:request];
|
NSData *data=[dataContorl stringToHexData:request];
|
||||||
|
|
||||||
UInt16 port = 333;
|
UInt16 port = 333;
|
||||||
UInt16 bindPort = 9954;
|
|
||||||
|
|
||||||
NSError *error;
|
|
||||||
|
|
||||||
[self.clientSocket enableBroadcast:YES error:&error];
|
|
||||||
|
|
||||||
[self.clientSocket sendData:data toHost:hostS port:port withTimeout:-1 tag:1];
|
[self.clientSocket sendData:data toHost:hostS port:port withTimeout:-1 tag:1];
|
||||||
|
|
||||||
//本地接收端口
|
|
||||||
[self.clientSocket bindToPort:bindPort error:&error];
|
|
||||||
|
|
||||||
[self.clientSocket receiveWithTimeout:-1 tag:0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)broadCastRestartCommand {
|
- (void)broadCastRestartCommand {
|
||||||
[self postmsg:@"命令已发出"];
|
[self postmsg:@"命令已发出"];
|
||||||
self.backMessageReceived = NO;
|
[self sendRestSocketData];
|
||||||
self.loopTimer = [NSTimer scheduledTimerWithTimeInterval:K_ReSendTimeInterval target:self selector:@selector(sendRestartSocketData) userInfo:nil repeats:YES];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)sendRestartSocketData {
|
- (void)sendRestartSocketData {
|
||||||
NSString* hostS = @"192.168.4.1";
|
NSString* hostS = @"192.168.4.1";
|
||||||
|
|
||||||
self.clientSocket = [[AsyncUdpSocket alloc] initWithDelegate:self];
|
|
||||||
//120.55.190.56 服务器IP 指令中用
|
//120.55.190.56 服务器IP 指令中用
|
||||||
RestartDeviceModel *model = [RestartDeviceModel new];
|
RestartDeviceModel *model = [RestartDeviceModel new];
|
||||||
NSString *request=[NSString stringWithFormat:@"%@", model.description];
|
NSString *request=[NSString stringWithFormat:@"%@", model.description];
|
||||||
|
|
@ -96,24 +89,13 @@
|
||||||
NSData *data=[dataContorl stringToHexData:request];
|
NSData *data=[dataContorl stringToHexData:request];
|
||||||
|
|
||||||
UInt16 port = 333;
|
UInt16 port = 333;
|
||||||
UInt16 bindPort = 9954;
|
|
||||||
|
|
||||||
NSError *error;
|
|
||||||
|
|
||||||
[self.clientSocket enableBroadcast:YES error:&error];
|
|
||||||
|
|
||||||
[self.clientSocket sendData:data toHost:hostS port:port withTimeout:-1 tag:1];
|
[self.clientSocket sendData:data toHost:hostS port:port withTimeout:-1 tag:1];
|
||||||
|
|
||||||
//本地接收端口
|
|
||||||
[self.clientSocket bindToPort:bindPort error:&error];
|
|
||||||
|
|
||||||
[self.clientSocket receiveWithTimeout:-1 tag:0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)sendConnectHotspotSoketdata{
|
-(void)sendConnectHotspotSoketdata{
|
||||||
NSString* hostS = @"192.168.4.1";
|
NSString* hostS = @"192.168.4.1";
|
||||||
|
|
||||||
self.clientSocket = [[AsyncUdpSocket alloc] initWithDelegate:self];
|
|
||||||
//120.55.190.56 服务器IP 指令中用
|
//120.55.190.56 服务器IP 指令中用
|
||||||
ConnectHotspotModel *model = [ConnectHotspotModel new];
|
ConnectHotspotModel *model = [ConnectHotspotModel new];
|
||||||
model.ssidName = _ssidName;
|
model.ssidName = _ssidName;
|
||||||
|
|
@ -123,27 +105,14 @@
|
||||||
NSData *data=[dataContorl stringToHexData:request];
|
NSData *data=[dataContorl stringToHexData:request];
|
||||||
|
|
||||||
UInt16 port = 333;
|
UInt16 port = 333;
|
||||||
UInt16 bindPort = 9954;
|
|
||||||
|
|
||||||
NSError *error;
|
|
||||||
|
|
||||||
[self.clientSocket enableBroadcast:YES error:&error];
|
|
||||||
|
|
||||||
[self.clientSocket sendData:data toHost:hostS port:port withTimeout:-1 tag:1];
|
[self.clientSocket sendData:data toHost:hostS port:port withTimeout:-1 tag:1];
|
||||||
|
|
||||||
//本地接收端口
|
|
||||||
[self.clientSocket bindToPort:bindPort error:&error];
|
|
||||||
|
|
||||||
[self.clientSocket receiveWithTimeout:-1 tag:0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-(BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port
|
-(BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port
|
||||||
{
|
{
|
||||||
if (self.backMessageReceived) {
|
[self.loopTimer invalidate];
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
self.backMessageReceived = YES;
|
|
||||||
NSString* result = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
|
NSString* result = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
|
||||||
IFishUDPHelperBackMsgModel *model = [[IFishUDPHelperBackMsgModel alloc] initWithData:data];
|
IFishUDPHelperBackMsgModel *model = [[IFishUDPHelperBackMsgModel alloc] initWithData:data];
|
||||||
if ([model.result isEqualToString:@"01"]) {
|
if ([model.result isEqualToString:@"01"]) {
|
||||||
|
|
@ -154,15 +123,12 @@
|
||||||
AppDelegate *app =(AppDelegate*)[UIApplication sharedApplication].delegate;
|
AppDelegate *app =(AppDelegate*)[UIApplication sharedApplication].delegate;
|
||||||
[app.window makeToast:[NSString stringWithFormat:@"收到答复:%@", result]];
|
[app.window makeToast:[NSString stringWithFormat:@"收到答复:%@", result]];
|
||||||
}
|
}
|
||||||
[self.clientSocket close];
|
|
||||||
[self.loopTimer invalidate];
|
|
||||||
return YES;
|
return YES;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)onUdpSocketDidClose:(AsyncUdpSocket *)sock{
|
-(void)onUdpSocketDidClose:(AsyncUdpSocket *)sock{
|
||||||
|
|
||||||
[self.clientSocket close];
|
|
||||||
[self.loopTimer invalidate];
|
[self.loopTimer invalidate];
|
||||||
NSLog(@"关闭");
|
NSLog(@"关闭");
|
||||||
}
|
}
|
||||||
|
|
@ -179,7 +145,6 @@
|
||||||
NSLog(@"dueToError%@",error);
|
NSLog(@"dueToError%@",error);
|
||||||
[self postmsg:error.localizedDescription];
|
[self postmsg:error.localizedDescription];
|
||||||
|
|
||||||
[self.clientSocket close];
|
|
||||||
[self.loopTimer invalidate];
|
[self.loopTimer invalidate];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue