290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
[_socket setBlocking: false];
if (![_socket of_connectSocketToAddress: &address
errNo: &errNo]) {
if (errNo == EINPROGRESS) {
SEL selector = @selector(socketDidConnect:context:
exception:);
[OFRunLoop of_addAsyncConnectForTCPSocket: _socket
target: self
selector: selector
context: nil];
return;
} else {
[_socket of_closeSocket];
|
>
>
|
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
|
[_socket setBlocking: false];
if (![_socket of_connectSocketToAddress: &address
errNo: &errNo]) {
if (errNo == EINPROGRESS) {
SEL selector = @selector(socketDidConnect:context:
exception:);
of_run_loop_mode_t mode = of_run_loop_mode_default;
[OFRunLoop of_addAsyncConnectForTCPSocket: _socket
mode: mode
target: self
selector: selector
context: nil];
return;
} else {
[_socket of_closeSocket];
|
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
|
}
- (void)asyncAcceptWithTarget: (id)target
selector: (SEL)selector
context: (id)context
{
[OFRunLoop of_addAsyncAcceptForTCPSocket: self
target: target
selector: selector
context: context];
}
#ifdef OF_HAVE_BLOCKS
- (void)asyncAcceptWithBlock: (of_tcp_socket_async_accept_block_t)block
{
[OFRunLoop of_addAsyncAcceptForTCPSocket: self
block: block];
}
#endif
- (const of_socket_address_t *)remoteAddress
{
if (_socket == INVALID_SOCKET)
|
>
>
|
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
|
}
- (void)asyncAcceptWithTarget: (id)target
selector: (SEL)selector
context: (id)context
{
[OFRunLoop of_addAsyncAcceptForTCPSocket: self
mode: of_run_loop_mode_default
target: target
selector: selector
context: context];
}
#ifdef OF_HAVE_BLOCKS
- (void)asyncAcceptWithBlock: (of_tcp_socket_async_accept_block_t)block
{
[OFRunLoop of_addAsyncAcceptForTCPSocket: self
mode: of_run_loop_mode_default
block: block];
}
#endif
- (const of_socket_address_t *)remoteAddress
{
if (_socket == INVALID_SOCKET)
|