Differences From Artifact [742dd6ce2f]:
- File src/OFTCPSocket.m — part of check-in [e40729d406] at 2013-02-12 18:22:15 on branch trunk — Prefix all ivars with an underscore. (user: js, size: 16319) [annotate] [blame] [check-ins using]
To Artifact [5920a82404]:
- File
src/OFTCPSocket.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 16332) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
211 212 213 214 215 216 217 | port: _port]; } @catch (OFException *e) { _exception = [[e retain] autorelease]; } [self performSelector: @selector(didConnect) onThread: _sourceThread | | | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | port: _port]; } @catch (OFException *e) { _exception = [[e retain] autorelease]; } [self performSelector: @selector(didConnect) onThread: _sourceThread waitUntilDone: false]; objc_autoreleasePoolPop(pool); return nil; } @end #endif |
︙ | ︙ | |||
277 278 279 280 281 282 283 | [_SOCKS5Host release]; [super dealloc]; } - (void)setSOCKS5Host: (OFString*)SOCKS5Host { | | | | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | [_SOCKS5Host release]; [super dealloc]; } - (void)setSOCKS5Host: (OFString*)SOCKS5Host { OF_SETTER(_SOCKS5Host, SOCKS5Host, true, 1) } - (OFString*)SOCKS5Host { OF_GETTER(_SOCKS5Host, true) } - (void)setSOCKS5Port: (uint16_t)SOCKS5Port { _SOCKS5Port = SOCKS5Port; } |
︙ | ︙ | |||
345 346 347 348 349 350 351 | } break; } freeaddrinfo(res0); #else | | | 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | } break; } freeaddrinfo(res0); #else bool connected = false; struct hostent *he; struct sockaddr_in addr; char **ip; # ifdef OF_HAVE_THREADS OFDataArray *addrlist; addrlist = [[OFDataArray alloc] initWithItemSize: sizeof(char**)]; |
︙ | ︙ | |||
409 410 411 412 413 414 415 | # endif memcpy(&addr.sin_addr.s_addr, *ip, he->h_length); if (connect(_socket, (struct sockaddr*)&addr, sizeof(addr)) == -1) continue; | | | 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 | # endif memcpy(&addr.sin_addr.s_addr, *ip, he->h_length); if (connect(_socket, (struct sockaddr*)&addr, sizeof(addr)) == -1) continue; connected = true; break; } # ifdef OF_HAVE_THREADS [addrlist release]; # endif |
︙ | ︙ | |||
631 632 633 634 635 636 637 | socket: self]; if (listen(_socket, backLog) == -1) @throw [OFListenFailedException exceptionWithClass: [self class] socket: self backLog: backLog]; | | | 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 | socket: self]; if (listen(_socket, backLog) == -1) @throw [OFListenFailedException exceptionWithClass: [self class] socket: self backLog: backLog]; _listening = true; } - (void)listen { [self listenWithBackLog: SOMAXCONN]; } |
︙ | ︙ | |||
678 679 680 681 682 683 684 | - (void)asyncAcceptWithBlock: (of_tcpsocket_async_accept_block_t)block { [OFRunLoop OF_addAsyncAcceptForTCPSocket: self block: block]; } #endif | | | 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 | - (void)asyncAcceptWithBlock: (of_tcpsocket_async_accept_block_t)block { [OFRunLoop OF_addAsyncAcceptForTCPSocket: self block: block]; } #endif - (void)setKeepAlivesEnabled: (bool)enable { int v = enable; if (setsockopt(_socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&v, sizeof(v))) @throw [OFSetOptionFailedException exceptionWithClass: [self class] stream: self]; |
︙ | ︙ | |||
736 737 738 739 740 741 742 | # endif #endif /* Get rid of a warning, never reached anyway */ assert(0); } | | | | 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 | # endif #endif /* Get rid of a warning, never reached anyway */ assert(0); } - (bool)isListening { return _listening; } - (void)close { [super close]; _listening = false; [self freeMemory: _sockAddr]; _sockAddr = NULL; _sockAddrLen = 0; } @end |