From 977fcadfe51a954914b5cdb14dcb74efbf85df21 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 3 Aug 2007 00:08:17 -0700 Subject: [PATCH] Any time we post a NsockError notifiation, we should also return out of the method so the execution actually stops (what a novel idea!) * Source/SocketWrapper.m --- Source/SocketWrapper.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/SocketWrapper.m b/Source/SocketWrapper.m index 3e2132e..78200ec 100644 --- a/Source/SocketWrapper.m +++ b/Source/SocketWrapper.m @@ -141,6 +141,7 @@ NSString *NsockDataSent = @"SocketWrapper_DataSent"; { close(socketOpen); [self _postNotification: NsockError withObject: @"Could not bind to socket"]; + return; } NSLog(@"couldn't bind to the socket... trying again in 5"); sleep(5); @@ -161,6 +162,7 @@ NSString *NsockDataSent = @"SocketWrapper_DataSent"; { close(socketOpen); [self _postNotification: NsockError withObject: @"Client failed to accept remote socket"]; + return; } // we're done listening now that we have a connection @@ -221,6 +223,7 @@ NSString *NsockDataSent = @"SocketWrapper_DataSent"; if (latest < 1) { [self _postNotification: NsockError withObject: @"Socket closed or could not be read"]; + return; } [data appendBytes: buffer length: latest]; recvd += latest; @@ -245,6 +248,7 @@ NSString *NsockDataSent = @"SocketWrapper_DataSent"; if (sent < 0) { [self _postNotification: NsockError withObject: @"Failed to write data to socket"]; + return; } if (sent < [data length]) { -- 2.22.5