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

Function socket_delete

components/net/sal/src/sal_socket.c:620–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620static void socket_delete(int socket)
621{
622 struct sal_socket *sock;
623 struct sal_socket_table *st = &socket_table;
624 int idx;
625
626 idx = socket - SAL_SOCKET_OFFSET;
627 if (idx < 0 || idx >= (int)st->max_socket)
628 {
629 return;
630 }
631 sal_lock();
632 sock = sal_get_socket(socket);
633 RT_ASSERT(sock != RT_NULL);
634 sock->magic = 0;
635 sock->netdev = RT_NULL;
636 socket_free(st, idx);
637 sal_unlock();
638}
639
640int sal_accept(int socket, struct sockaddr *addr, socklen_t *addrlen)
641{

Callers 3

sal_acceptFunction · 0.85
sal_socketFunction · 0.85
sal_closesocketFunction · 0.85

Calls 4

sal_lockFunction · 0.85
sal_get_socketFunction · 0.85
socket_freeFunction · 0.85
sal_unlockFunction · 0.85

Tested by

no test coverage detected