Differences From Artifact [692cbbd5b1]:
- File
src/OFRunLoop.m
— part of check-in
[d16ad96cbd]
at
2018-12-07 01:33:47
on branch trunk
— OFStream: Use a delegate for async operations
The target / selector approach had several drawbacks:
* It was inconvenient to use, as for every read or write, a target,
selector and context would need to be specified.
* It lacked any kind of type-safety and would not even warn about using
a callback method with the wrong number of parameters.
* It encouraged using a different callback method for each read or
write call, which results in code that is hard to follow and also
slower (as it needs to recreate the async operation with a new
callback every time). (user: js, size: 28736) [annotate] [blame] [check-ins using]
To Artifact [ab8e75f5ed]:
- File src/OFRunLoop.m — part of check-in [27153bf8cf] at 2018-12-08 16:05:51 on branch trunk — OFTCPSocket: Use a delegate for async operations (user: js, size: 28713) [annotate] [blame] [check-ins using]
︙ | |||
563 564 565 566 567 568 569 | 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | - + - + - + - + + + + + - - - + + + + + + + + - + - + | return false; } @end @implementation OFRunLoop_AcceptQueueItem - (bool)handleObject: (id)object { |
︙ | |||
819 820 821 822 823 824 825 | 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 | - - - + - - - - + - | }) } + (void)of_addAsyncConnectForTCPSocket: (OFTCPSocket *)stream mode: (of_run_loop_mode_t)mode target: (id)target selector: (SEL)selector |
︙ |