Differences From Artifact [9559b91b20]:
- File src/OFUDPSocket.m — part of check-in [3501205f07] at 2018-12-18 17:10:58 on branch trunk — Slightly decrease binary size (user: js, size: 12072) [annotate] [blame] [check-ins using]
To Artifact [83f1dff89c]:
- File
src/OFUDPSocket.m
— part of check-in
[0f3ae90eef]
at
2018-12-18 21:17:28
on branch trunk
— Use OFData instead of a buffer for async UDP sends
This avoids the entire problem of keeping the buffer alive until the
send finished. (user: js, size: 11859) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
412 413 414 415 416 417 418 | if ((size_t)bytesWritten != length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length bytesWritten: bytesWritten errNo: 0]; } | | < | | < | | | < | | | < | < | | | < | | | | < | | | | < | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
if ((size_t)bytesWritten != length)
@throw [OFWriteFailedException exceptionWithObject: self
requestedLength: length
bytesWritten: bytesWritten
errNo: 0];
}
- (void)asyncSendData: (OFData *)data
receiver: (const of_socket_address_t *)receiver
{
[self asyncSendData: data
receiver: receiver
runLoopMode: of_run_loop_mode_default];
}
- (void)asyncSendData: (OFData *)data
receiver: (const of_socket_address_t *)receiver
runLoopMode: (of_run_loop_mode_t)runLoopMode
{
[OFRunLoop of_addAsyncSendForUDPSocket: self
data: data
receiver: receiver
mode: runLoopMode
# ifdef OF_HAVE_BLOCKS
block: NULL
# endif
delegate: _delegate];
}
#ifdef OF_HAVE_BLOCKS
- (void)asyncSendData: (OFData *)data
receiver: (const of_socket_address_t *)receiver
block: (of_udp_socket_async_send_data_block_t)block
{
[self asyncSendData: data
receiver: receiver
runLoopMode: of_run_loop_mode_default
block: block];
}
- (void)asyncSendData: (OFData *)data
receiver: (const of_socket_address_t *)receiver
runLoopMode: (of_run_loop_mode_t)runLoopMode
block: (of_udp_socket_async_send_data_block_t)block
{
[OFRunLoop of_addAsyncSendForUDPSocket: self
data: data
receiver: receiver
mode: runLoopMode
block: block
delegate: nil];
}
#endif
|
| ︙ | ︙ |