19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include "config.h"
#include <errno.h>
#import "OFAsyncIPSocketConnector.h"
#import "OFData.h"
#import "OFTCPSocket.h"
#import "OFThread.h"
#import "OFTimer.h"
#import "OFConnectIPSocketFailedException.h"
#import "OFInvalidFormatException.h"
|
>
>
>
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include "config.h"
#include <errno.h>
#import "OFAsyncIPSocketConnector.h"
#import "OFData.h"
#ifdef OF_HAVE_SCTP
# import "OFSCTPSocket.h"
#endif
#import "OFTCPSocket.h"
#import "OFThread.h"
#import "OFTimer.h"
#import "OFConnectIPSocketFailedException.h"
#import "OFInvalidFormatException.h"
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
if (_exception == nil)
[_socket setCanBlock: true];
#ifdef OF_HAVE_BLOCKS
if (_block != NULL) {
if ([_socket isKindOfClass: [OFTCPSocket class]])
((OFTCPSocketAsyncConnectBlock)_block)(_exception);
else
OFEnsure(0);
} else {
#endif
if ([_delegate respondsToSelector:
@selector(socket:didConnectToHost:port:exception:)])
[_delegate socket: _socket
|
>
>
>
>
|
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
if (_exception == nil)
[_socket setCanBlock: true];
#ifdef OF_HAVE_BLOCKS
if (_block != NULL) {
if ([_socket isKindOfClass: [OFTCPSocket class]])
((OFTCPSocketAsyncConnectBlock)_block)(_exception);
# ifdef OF_HAVE_SCTP
else if ([_socket isKindOfClass: [OFSCTPSocket class]])
((OFSCTPSocketAsyncConnectBlock)_block)(_exception);
# endif
else
OFEnsure(0);
} else {
#endif
if ([_delegate respondsToSelector:
@selector(socket:didConnectToHost:port:exception:)])
[_delegate socket: _socket
|