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

Function lwip_tryget_socket

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

* 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 */

Source from the content-addressed store, hash-verified

476 * @return struct lwip_sock for the socket or NULL if not found
477 */
478struct lwip_sock *
479lwip_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.

Callers 4

event_callbackFunction · 0.50
inet_socketFunction · 0.50
inet_acceptFunction · 0.50
inet_pollFunction · 0.50

Calls 2

tryget_socket_unconnFunction · 0.85
done_socketFunction · 0.85

Tested by

no test coverage detected