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

Function xs_socket_close

modules/network/socket/lwip/modSocket.c:462–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462void xs_socket_close(xsMachine *the)
463{
464 xsSocket xss = xsmcGetHostData(xsThis);
465
466 if (NULL == xss)
467 return;
468
469 xsmcGetHostDataValidate(xsThis, xs_socket_destructor);
470
471 xsmcSetHostDestructor(xsThis, NULL);
472 xsmcSetHostData(xsThis, NULL);
473 xsForget(xss->obj);
474
475 closeSocket(xss);
476
477 if (!(xss->pending & kPendingClose))
478 socketSetPending(xss, kPendingClose);
479
480 if (xss->connecting) {
481 xss->connecting = 0;
482 socketDownUseCount(the, xss);
483 }
484}
485
486void xs_socket_get(xsMachine *the)
487{

Callers

nothing calls this directly

Calls 3

closeSocketFunction · 0.85
socketSetPendingFunction · 0.85
socketDownUseCountFunction · 0.70

Tested by

no test coverage detected