Overview
Comment: | Use closesocket() instead of close()
Previously, socket_helpers.h would just define close() to whatever is |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
b4cd87cd81f4a2f332baa522959bf0e4 |
User & Date: | js on 2017-05-21 23:57:34 |
Other Links: | manifest | tags |
Context
2017-05-22
| ||
22:00 | Omit check for select() / poll() on certain OSes check-in: f81f162b33 user: js tags: trunk | |
2017-05-21
| ||
23:57 | Use closesocket() instead of close() check-in: b4cd87cd81 user: js tags: trunk | |
21:33 | OFThreadPool: Fix missing autorelease pool check-in: 9558a93c7e user: js tags: trunk | |
Changes
Modified src/OFKernelEventObserver.m from [1a2dbaaf85] to [01c61511ac].
︙ | |||
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | + + + + + + | } return self; } - (void)dealloc { #ifdef OF_HAVE_PIPE close(_cancelFD[0]); if (_cancelFD[1] != _cancelFD[0]) close(_cancelFD[1]); #else closesocket(_cancelFD[0]); if (_cancelFD[1] != _cancelFD[0]) closesocket(_cancelFD[1]); #endif [_readObjects release]; [_writeObjects release]; #ifdef OF_HAVE_THREADS [_mutex release]; #endif |
︙ |
Modified src/OFStreamSocket.m from [d2e763431e] to [c248fb563e].
︙ | |||
165 166 167 168 169 170 171 | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | - + | } - (void)close { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; |
︙ |
Modified src/OFTCPSocket.m from [b98f01fc09] to [16f6a959b9].
︙ | |||
283 284 285 286 287 288 289 | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | - + | fcntl(_socket, F_SETFD, flags | FD_CLOEXEC); #endif if (connect(_socket, result->address, result->addressLength) == -1) { errNo = of_socket_errno(); |
︙ | |||
396 397 398 399 400 401 402 | 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | - + | #if defined(OF_WII) || defined(OF_NINTENDO_3DS) if (port != 0) { #endif if (bind(_socket, results[0]->address, results[0]->addressLength) != 0) { int errNo = of_socket_errno(); |
︙ | |||
443 444 445 446 447 448 449 | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | - + | port = rnd; break; } if (of_socket_errno() != EADDRINUSE) { int errNo = of_socket_errno(); |
︙ | |||
468 469 470 471 472 473 474 | 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | - + - + | #if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) addrLen = (socklen_t)sizeof(addr.storage); if (of_getsockname(_socket, (struct sockaddr *)&addr.storage, &addrLen) != 0) { int errNo = of_socket_errno(); |
︙ |
Modified src/OFUDPSocket.m from [06ff6d8241] to [83754f70d8].
︙ | |||
420 421 422 423 424 425 426 | 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | - + | #if defined(OF_WII) || defined(OF_NINTENDO_3DS) if (port != 0) { #endif if (bind(_socket, results[0]->address, results[0]->addressLength) != 0) { int errNo = of_socket_errno(); |
︙ | |||
467 468 469 470 471 472 473 | 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | - + | port = rnd; break; } if (of_socket_errno() != EADDRINUSE) { int errNo = of_socket_errno(); |
︙ | |||
492 493 494 495 496 497 498 | 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 | - + - + | #if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) addrLen = (socklen_t)sizeof(addr.storage); if (of_getsockname(_socket, (struct sockaddr *)&addr.storage, &addrLen) != 0) { int errNo = of_socket_errno(); |
︙ | |||
646 647 648 649 650 651 652 | 646 647 648 649 650 651 652 653 654 655 656 | - + | } - (void)close { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; |
Modified src/socket_helpers.h from [2eb48e2252] to [77b020019f].
︙ | |||
57 58 59 60 61 62 63 | 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 | - - + + - + | # define SOMAXCONN 16 #endif #ifndef SOCK_CLOEXEC # define SOCK_CLOEXEC 0 #endif |
︙ |