diff --git a/ChangeLog b/ChangeLog index d32ffc28b..24e00e9c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-09-20 Richard Frith-Macdonald + + * Source/GSTcpHandle.m: ([-connectToPort:beforeDate:]) Added more + informative logging for problem condition reported by Nicila ... + perhaps it will help tracking down cause. + 2002-09-19 Richard Frith-Macdonald * Source/GSFormat.m: Where a %p format prints a null pointer, diff --git a/Source/GSTcpPort.m b/Source/GSTcpPort.m index 0ab62fab8..ca0e82189 100644 --- a/Source/GSTcpPort.m +++ b/Source/GSTcpPort.m @@ -462,10 +462,27 @@ static Class runLoopClass; self, GSCurrentThread(), when); if (state != GS_H_UNCON) { - NSLog(@"attempting connect on connected handle"); + BOOL result; + + if (state == GS_H_CONNECTED) /* Already connected. */ + { + NSLog(@"attempting connect on connected handle"); + result = YES; + } + else if (state == GS_H_ACCEPT) /* Impossible. */ + { + NSLog(@"attempting connect with accepting handle"); + result = NO; + } + else /* Already connecting. */ + { + NSLog(@"attempting connect while connecting"); + result = NO; + } DO_UNLOCK(myLock); - return YES; /* Already connected. */ + return result; } + if (recvPort == nil || aPort == nil) { NSLog(@"attempting connect with port(s) unset");