socket使用结束时调用close方法
This commit is contained in:
@@ -154,6 +154,7 @@
|
||||
AppDelegate *app =(AppDelegate*)[UIApplication sharedApplication].delegate;
|
||||
[app.window makeToast:[NSString stringWithFormat:@"收到答复:%@", result]];
|
||||
}
|
||||
[self.clientSocket close];
|
||||
[self.loopTimer invalidate];
|
||||
return YES;
|
||||
|
||||
@@ -161,6 +162,7 @@
|
||||
|
||||
-(void)onUdpSocketDidClose:(AsyncUdpSocket *)sock{
|
||||
|
||||
[self.clientSocket close];
|
||||
[self.loopTimer invalidate];
|
||||
NSLog(@"关闭");
|
||||
}
|
||||
@@ -176,12 +178,15 @@
|
||||
|
||||
NSLog(@"dueToError%@",error);
|
||||
[self postmsg:error.localizedDescription];
|
||||
|
||||
[self.clientSocket close];
|
||||
[self.loopTimer invalidate];
|
||||
}
|
||||
|
||||
|
||||
-(void)dealloc{
|
||||
|
||||
[self.clientSocket close];
|
||||
[self.loopTimer invalidate];
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user