# HG changeset patch # User Jens Alfke # Date 1213139660 25200 # Node ID f723174fbc24592513dcf1ad6d8ccc9d8a7c16a9 # Parent bb5faa9995d543d1e274fd5b37b31c5e251edb14 Fixed: The -connection:failedToOpen: delegate method wasn't being called. diff -r bb5faa9995d5 -r f723174fbc24 TCP/TCPConnection.m --- a/TCP/TCPConnection.m Wed Jun 04 21:09:45 2008 -0700 +++ b/TCP/TCPConnection.m Tue Jun 10 16:14:20 2008 -0700 @@ -255,8 +255,12 @@ { if( _status != kTCP_Closed && _status != kTCP_Disconnected ) { LogTo(TCP,@"%@ is now closed",self); - self.status = (_status==kTCP_Closing ?kTCP_Closed :kTCP_Disconnected); - [self tellDelegate: @selector(connectionDidClose:) withObject: nil]; + TCPConnectionStatus prevStatus = _status; + self.status = (prevStatus==kTCP_Closing ?kTCP_Closed :kTCP_Disconnected); + if( prevStatus==kTCP_Opening ) + [self tellDelegate: @selector(connection:failedToOpen:) withObject: self.error]; + else + [self tellDelegate: @selector(connectionDidClose:) withObject: nil]; } [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(_closeTimeoutExpired)