Differences From Artifact [02b97312cb]:
- File
src/OFRunLoop+Private.h
— 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: 4630) [annotate] [blame] [check-ins using]
To Artifact [de6ad95d5c]:
- File src/OFRunLoop+Private.h — 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: 4543) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
51 52 53 54 55 56 57 | buffer: (const void *)buffer length: (size_t)length mode: (of_run_loop_mode_t)mode delegate: (id <OFStreamDelegate>)delegate; + (void)of_addAsyncConnectForTCPSocket: (OFTCPSocket *)socket mode: (of_run_loop_mode_t)mode target: (id)target | | < | < < | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | buffer: (const void *)buffer length: (size_t)length mode: (of_run_loop_mode_t)mode delegate: (id <OFStreamDelegate>)delegate; + (void)of_addAsyncConnectForTCPSocket: (OFTCPSocket *)socket mode: (of_run_loop_mode_t)mode target: (id)target selector: (SEL)selector; + (void)of_addAsyncAcceptForTCPSocket: (OFTCPSocket *)socket mode: (of_run_loop_mode_t)mode delegate: (id <OFTCPSocketDelegate>)delegate; + (void)of_addAsyncReceiveForUDPSocket: (OFUDPSocket *)socket buffer: (void *)buffer length: (size_t)length mode: (of_run_loop_mode_t)mode target: (id)target selector: (SEL)selector context: (nullable id)context; |
︙ | ︙ |