538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
|
if (exception != nil) {
if ([exception isKindOfClass: [OFWriteFailedException class]] &&
([exception errNo] == ECONNRESET ||
[exception errNo] == EPIPE)) {
/* In case a keep-alive connection timed out */
[self closeAndReconnect];
return false;
}
[_client->_delegate client: _client
didEncounterException: exception
forRequest: _request
context: _context];
return 0;
|
|
|
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
|
if (exception != nil) {
if ([exception isKindOfClass: [OFWriteFailedException class]] &&
([exception errNo] == ECONNRESET ||
[exception errNo] == EPIPE)) {
/* In case a keep-alive connection timed out */
[self closeAndReconnect];
return 0;
}
[_client->_delegate client: _client
didEncounterException: exception
forRequest: _request
context: _context];
return 0;
|
603
604
605
606
607
608
609
610
611
612
613
614
615
616
|
}
}
- (void)socketDidConnect: (OFTCPSocket *)socket
context: (id)context
exception: (id)exception
{
if ([_client->_delegate respondsToSelector:
@selector(client:didCreateSocket:forRequest:context:)])
[_client->_delegate client: _client
didCreateSocket: socket
forRequest: _request
context: _context];
|
>
>
>
>
>
>
>
>
|
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
|
}
}
- (void)socketDidConnect: (OFTCPSocket *)socket
context: (id)context
exception: (id)exception
{
if (exception != nil) {
[_client->_delegate client: _client
didEncounterException: exception
forRequest: _request
context: _context];
return;
}
if ([_client->_delegate respondsToSelector:
@selector(client:didCreateSocket:forRequest:context:)])
[_client->_delegate client: _client
didCreateSocket: socket
forRequest: _request
context: _context];
|