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

Function closeSocket

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

Source from the content-addressed store, hash-verified

414}
415
416static void closeSocket(xsSocket xss)
417{
418 if (xss->skt) {
419 tcp_recv(xss->skt, NULL);
420 tcp_sent(xss->skt, NULL);
421 tcp_err(xss->skt, NULL);
422 tcp_close_safe(xss->skt);
423 xss->skt = NULL;
424 modInstrumentationAdjust(NetworkSockets, -1);
425 }
426
427 if (xss->udp) {
428 udp_recv(xss->udp, NULL, NULL);
429 udp_remove_safe(xss->udp);
430 xss->udp = NULL;
431 modInstrumentationAdjust(NetworkSockets, -1);
432 }
433
434 if (xss->raw) {
435 raw_recv(xss->raw, NULL, NULL);
436 raw_remove(xss->raw);
437 xss->raw = NULL;
438 modInstrumentationAdjust(NetworkSockets, -1);
439 }
440}
441
442void xs_socket_destructor(void *data)
443{

Callers 2

xs_socket_destructorFunction · 0.85
xs_socket_closeFunction · 0.85

Calls 2

tcp_close_safeFunction · 0.85
udp_remove_safeFunction · 0.85

Tested by

no test coverage detected