72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
-
+
|
((OFTCPSocketAsyncConnectBlock)_block)(_exception);
else
OFEnsure(0);
} else {
#endif
if ([_delegate respondsToSelector:
@selector(socket:didConnectToHost:port:exception:)])
[_delegate socket: _socket
[_delegate socket: _socket
didConnectToHost: _host
port: _port
exception: _exception];
#ifdef OF_HAVE_BLOCKS
}
#endif
}
|
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
+
+
+
+
|
[_socket setCanBlock: true];
#else
[_socket setCanBlock: false];
#endif
if (![_socket of_connectSocketToAddress: &address errNo: &errNo]) {
#if !defined(OF_NINTENDO_3DS) && !defined(OF_WII)
# ifdef OF_WINDOWS
if (errNo == EINPROGRESS || errNo == EWOULDBLOCK) {
# else
if (errNo == EINPROGRESS) {
# endif
[OFRunLoop of_addAsyncConnectForSocket: _socket
mode: runLoopMode
delegate: self];
return;
} else {
#endif
[_socket of_closeSocket];
|