Fix of crash when network is unreachable during connecting
This commit is contained in:
parent
4b99d73adf
commit
7719285010
@ -152,17 +152,17 @@ BOOL wasOpenned = FALSE;
|
||||
case NSStreamEventErrorOccurred:
|
||||
{
|
||||
NSLog(@"Stream event error: %@", [[stream streamError] localizedDescription]);
|
||||
|
||||
|
||||
[self close];
|
||||
|
||||
if (wasOpenned) {
|
||||
self.errorEventHandler([[stream streamError] localizedDescription]);
|
||||
self.closeEventHandler(TRUE);
|
||||
}
|
||||
else {
|
||||
self.openErrorEventHandler([[stream streamError] localizedDescription]);
|
||||
self.errorEventHandler([[stream streamError] localizedDescription]);
|
||||
self.openErrorEventHandler([[stream streamError] localizedDescription]);
|
||||
}
|
||||
|
||||
[self close];
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
Loading…
Reference in New Issue
Block a user