MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / doDestructor

Function doDestructor

modules/network/socket/qca4020/modSocket.c:520–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520void doDestructor(xsSocket xss)
521{
522 xsSocket walker, prev = NULL;
523 xss->done = 1;
524
525 for (walker = gSockets; NULL != walker; prev = walker, walker = walker->next) {
526 if (xss == walker) {
527 if (NULL == prev)
528 gSockets = walker->next;
529 else
530 prev->next = walker->next;
531 break;
532 }
533 }
534 if (NULL == gSockets && NULL != gTimer) {
535 modTimerRemove(gTimer);
536 gTimer = NULL;
537 }
538
539 if (-1 != xss->skt) {
540 modInstrumentationAdjust(NetworkSockets, -1);
541 close(xss->skt);
542 xss->skt = -1;
543 }
544}
545
546void xs_socket_destructor(void *data)
547{

Callers 3

socketDisconnectedFunction · 0.70
socketReadableFunction · 0.70
xs_socket_destructorFunction · 0.70

Calls 2

modTimerRemoveFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected