Differences From Artifact [9927726f3b]:
- File src/OFTCPSocket.m — part of check-in [3501205f07] at 2018-12-18 17:10:58 on branch trunk — Slightly decrease binary size (user: js, size: 25794) [annotate] [blame] [check-ins using]
To Artifact [b5ab8aeaeb]:
- File
src/OFTCPSocket.m
— part of check-in
[0afb04d93c]
at
2018-12-22 00:29:42
on branch trunk
— OFDNSResolver: Use a delegate for async operations
Because there is usually only one resolver per thread, having the
delegate as a property on the resolver would not work. It is therefore
passed as an argument.This only changes the public API so far. Internally, the old target /
selector / context pattern is still being used. This will be changed
later. (user: js, size: 25444) [annotate] [blame] [check-ins using]
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | - - + + | Class of_tls_socket_class = Nil; static of_run_loop_mode_t connectRunLoopMode = @"of_tcp_socket_connect_mode"; static OFString *defaultSOCKS5Host = nil; static uint16_t defaultSOCKS5Port = 1080; |
︙ | |||
104 105 106 107 108 109 110 | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | - - - - - - + | port: (uint16_t)port SOCKS5Host: (OFString *)SOCKS5Host SOCKS5Port: (uint16_t)SOCKS5Port block: (of_tcp_socket_async_connect_block_t)block; #endif - (void)didConnect; - (void)tryNextAddressWithRunLoopMode: (of_run_loop_mode_t)runLoopMode; |
︙ | |||
300 301 302 303 304 305 306 | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | - | [self didConnect]; } - (void)resolver: (OFDNSResolver *)resolver didResolveDomainName: (OFString *)domainName socketAddresses: (OFData *)socketAddresses |
︙ | |||
349 350 351 352 353 354 355 | 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | - + - - - - - | } @catch (OFInvalidFormatException *e) { } [[OFThread DNSResolver] asyncResolveSocketAddressesForHost: host addressFamily: OF_SOCKET_ADDRESS_FAMILY_ANY runLoopMode: runLoopMode |
︙ | |||
726 727 728 729 730 731 732 | 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 | - + | - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode { void *pool = objc_autoreleasePoolPush(); |
︙ | |||
756 757 758 759 760 761 762 | 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 | - + | - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode block: (of_tcp_socket_async_connect_block_t)block { void *pool = objc_autoreleasePoolPush(); |
︙ |