310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
# ifdef OF_HAVE_BLOCKS
if (_block != NULL)
return _block(object, _buffer, length, address, exception);
else {
# endif
bool (*func)(id, SEL, OFUDPSocket *, void *, size_t,
of_udp_socket_address_t address, OFException *) =
(bool (*)(id, SEL, OFUDPSocket *, void *, size_t,
of_udp_socket_address_t, OFException *))
[_target methodForSelector: _selector];
return func(_target, _selector, object, _buffer, length,
address, exception);
# ifdef OF_HAVE_BLOCKS
|
|
|
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
# ifdef OF_HAVE_BLOCKS
if (_block != NULL)
return _block(object, _buffer, length, address, exception);
else {
# endif
bool (*func)(id, SEL, OFUDPSocket *, void *, size_t,
of_udp_socket_address_t, OFException *) =
(bool (*)(id, SEL, OFUDPSocket *, void *, size_t,
of_udp_socket_address_t, OFException *))
[_target methodForSelector: _selector];
return func(_target, _selector, object, _buffer, length,
address, exception);
# ifdef OF_HAVE_BLOCKS
|
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
|
{
ADD_READ(OFRunLoop_AcceptQueueItem, stream, {
queueItem->_target = [target retain];
queueItem->_selector = selector;
})
}
+ (void)of_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket
buffer: (void *)buffer
length: (size_t)length
target: (id)target
selector: (SEL)selector
{
ADD_READ(OFRunLoop_UDPReceiveQueueItem, socket, {
queueItem->_buffer = buffer;
queueItem->_length = length;
queueItem->_target = [target retain];
queueItem->_selector = selector;
})
}
|
|
|
|
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
|
{
ADD_READ(OFRunLoop_AcceptQueueItem, stream, {
queueItem->_target = [target retain];
queueItem->_selector = selector;
})
}
+ (void)of_addAsyncReceiveForUDPSocket: (OFUDPSocket *)sock
buffer: (void *)buffer
length: (size_t)length
target: (id)target
selector: (SEL)selector
{
ADD_READ(OFRunLoop_UDPReceiveQueueItem, sock, {
queueItem->_buffer = buffer;
queueItem->_length = length;
queueItem->_target = [target retain];
queueItem->_selector = selector;
})
}
|
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
|
block: (of_tcp_socket_async_accept_block_t)block
{
ADD_READ(OFRunLoop_AcceptQueueItem, stream, {
queueItem->_block = [block copy];
})
}
+ (void)of_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket
buffer: (void *)buffer
length: (size_t)length
block: (of_udp_socket_async_receive_block_t)
block
{
ADD_READ(OFRunLoop_UDPReceiveQueueItem, socket, {
queueItem->_buffer = buffer;
queueItem->_length = length;
queueItem->_block = [block copy];
})
}
# endif
# undef ADD_READ
|
|
|
|
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
|
block: (of_tcp_socket_async_accept_block_t)block
{
ADD_READ(OFRunLoop_AcceptQueueItem, stream, {
queueItem->_block = [block copy];
})
}
+ (void)of_addAsyncReceiveForUDPSocket: (OFUDPSocket *)sock
buffer: (void *)buffer
length: (size_t)length
block: (of_udp_socket_async_receive_block_t)
block
{
ADD_READ(OFRunLoop_UDPReceiveQueueItem, sock, {
queueItem->_buffer = buffer;
queueItem->_length = length;
queueItem->_block = [block copy];
})
}
# endif
# undef ADD_READ
|