@@ -49,11 +49,11 @@ #import "OFUnsupportedVersionException.h" #import "OFWriteFailedException.h" #define REDIRECTS_DEFAULT 10 -@interface OFHTTPClientRequestHandler: OFObject +@interface OFHTTPClientRequestHandler: OFObject { @public OFHTTPClient *_client; OFHTTPRequest *_request; OFString *_requestString; @@ -613,20 +613,15 @@ [self raiseException: e]; return; } } -- (void)socketDidConnect: (OFTCPSocket *)sock - context: (id)context - exception: (id)exception -{ - if (exception != nil) { - [self raiseException: exception]; - return; - } - - [sock setDelegate: self]; +- (void)socket: (OF_KINDOF(OFTCPSocket *))sock + didConnectToHost: (OFString *)host + port: (uint16_t)port +{ + [(OFTCPSocket *)sock setDelegate: self]; if ([_client->_delegate respondsToSelector: @selector(client:didCreateSocket:request:context:)]) [_client->_delegate client: _client didCreateSocket: sock @@ -695,16 +690,13 @@ URLPort = [URL port]; if (URLPort != nil) port = [URLPort uInt16Value]; + [sock setDelegate: self]; [sock asyncConnectToHost: [URL host] - port: port - target: self - selector: @selector(socketDidConnect:context: - exception:) - context: nil]; + port: port]; } @catch (id e) { [self raiseException: e]; } } @end