Differences From Artifact [35a4b455a8]:
- File src/OFUDPSocket.m — part of check-in [842c55dd83] at 2017-09-24 17:35:04 on branch trunk — OFUDPSocket: Add support for async sending (user: js, size: 15814) [annotate] [blame] [check-ins using]
To Artifact [8a3b636da1]:
- File
src/OFUDPSocket.m
— part of check-in
[2f4e0df8be]
at
2017-10-17 00:33:37
on branch trunk
— Do not use implicit method return types
Instead, explicitly declare them, as OF_ASSUME_NONNULL_{BEGIN,END} does
not apply to implicit return types. This means that after this commit,
all init methods have a nonnull return type, as they should have. (user: js, size: 15924) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
55 56 57 58 59 60 61 | # ifdef OF_HAVE_BLOCKS of_udp_socket_async_resolve_block_t _block; # endif of_udp_socket_address_t _address; id _exception; } | | | | | | | | | | | > | | | | | | | | | | | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# ifdef OF_HAVE_BLOCKS
of_udp_socket_async_resolve_block_t _block;
# endif
of_udp_socket_address_t _address;
id _exception;
}
- (instancetype)initWithSourceThread: (OFThread *)sourceThread
host: (OFString *)host
port: (uint16_t)port
target: (id)target
selector: (SEL)selector
context: (id)context;
# ifdef OF_HAVE_BLOCKS
- (instancetype)initWithSourceThread: (OFThread *)sourceThread
host: (OFString *)host
port: (uint16_t)port
block: (of_udp_socket_async_resolve_block_t)
block;
# endif
@end
@implementation OFUDPSocket_ResolveThread
- (instancetype)initWithSourceThread: (OFThread *)sourceThread
host: (OFString *)host
port: (uint16_t)port
target: (id)target
selector: (SEL)selector
context: (id)context
{
self = [super init];
@try {
_sourceThread = [sourceThread retain];
_host = [host retain];
_port = port;
_target = [target retain];
_selector = selector;
_context = [context retain];
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
# ifdef OF_HAVE_BLOCKS
- (instancetype)initWithSourceThread: (OFThread *)sourceThread
host: (OFString *)host
port: (uint16_t)port
block: (of_udp_socket_async_resolve_block_t)block
{
self = [super init];
@try {
_sourceThread = [sourceThread retain];
_host = [host copy];
_port = port;
|
| ︙ | ︙ | |||
366 367 368 369 370 371 372 |
andPort: (uint16_t *)port
forAddress: (of_udp_socket_address_t *)address
{
of_address_to_string_and_port(
(struct sockaddr *)&address->address, address->length, host, port);
}
| | | | 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
andPort: (uint16_t *)port
forAddress: (of_udp_socket_address_t *)address
{
of_address_to_string_and_port(
(struct sockaddr *)&address->address, address->length, host, port);
}
- (instancetype)init
{
self = [super init];
_socket = INVALID_SOCKET;
return self;
}
- (void)dealloc
{
if (_socket != INVALID_SOCKET)
[self close];
[super dealloc];
}
- (id)copy
{
return [self retain];
}
- (uint16_t)bindToHost: (OFString *)host
port: (uint16_t)port
{
|
| ︙ | ︙ |