* Same as tryget_socket but a global routine. * * @param fd externally used socket index * @return struct lwip_sock for the socket or NULL if not found */
| 476 | * @return struct lwip_sock for the socket or NULL if not found |
| 477 | */ |
| 478 | struct lwip_sock * |
| 479 | lwip_tryget_socket(int fd) |
| 480 | { |
| 481 | struct lwip_sock *sock = tryget_socket_unconn(fd); |
| 482 | if (sock != NULL) { |
| 483 | if (sock->conn) { |
| 484 | return sock; |
| 485 | } |
| 486 | done_socket(sock); |
| 487 | } |
| 488 | return NULL; |
| 489 | } |
| 490 | |
| 491 | /** |
| 492 | * Map a externally used socket index to the internal socket representation. |
no test coverage detected