MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / tryget_socket

Function tryget_socket

components/net/lwip/lwip-2.1.2/src/api/sockets.c:459–470  ·  view source on GitHub ↗

* Same as get_socket but doesn't set errno * * @param fd externally used socket index * @return struct lwip_sock for the socket or NULL if not found */

Source from the content-addressed store, hash-verified

457 * @return struct lwip_sock for the socket or NULL if not found
458 */
459static struct lwip_sock *
460tryget_socket(int fd)
461{
462 struct lwip_sock *sock = tryget_socket_unconn(fd);
463 if (sock != NULL) {
464 if (sock->conn) {
465 return sock;
466 }
467 done_socket(sock);
468 }
469 return NULL;
470}
471
472/**
473 * Same as tryget_socket but a global routine.

Callers 3

get_socketFunction · 0.70
lwip_getsockopt_implFunction · 0.70
lwip_setsockopt_implFunction · 0.70

Calls 2

tryget_socket_unconnFunction · 0.85
done_socketFunction · 0.85

Tested by

no test coverage detected