Differences From Artifact [3c90c2bfad]:
- File src/OFUDPSocket.m — part of check-in [fc73801932] at 2015-10-04 11:30:52 on branch trunk — Better length checks for write / send calls (user: js, size: 13301) [annotate] [blame] [check-ins using] [more...]
To Artifact [b7f838da94]:
- File
src/OFUDPSocket.m
— part of check-in
[ed4549ddd3]
at
2015-10-17 10:59:15
on branch trunk
— Add a port registry for the Wii
This is necessary as the Wii does not allow picking a random free port,
and thus we need to track which ports are used. (user: js, size: 13789) [annotate] [blame] [check-ins using]
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | - - - - | #import "OFReadFailedException.h" #import "OFWriteFailedException.h" #import "socket.h" #import "socket_helpers.h" #import "resolver.h" |
︙ | |||
399 400 401 402 403 404 405 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | + + + - + + + + - + + + + + + + + | # endif } addr; socklen_t addrLen; #endif #ifdef __wii__ if (port == 0) port = of_socket_port_find(SOCK_DGRAM); else if (!of_socket_port_register(port, SOCK_DGRAM)) @throw [OFBindFailedException exceptionWithHost: host |
︙ | |||
434 435 436 437 438 439 440 441 442 443 444 | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | + + + + + - + + + + + | _socket = INVALID_SOCKET; @throw [OFBindFailedException exceptionWithHost: host port: port socket: self errNo: errNo]; } } @catch (id e) { #ifdef __wii__ of_socket_port_free(port, SOCK_DGRAM); #endif @throw e; } @finally { of_resolver_free(results); } |
︙ | |||
603 604 605 606 607 608 609 | 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 | - + + + + + + + + | - (void)close { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; close(_socket); _socket = INVALID_SOCKET; |