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

Function doClose

modules/io/socket/zephyr/tcp.c:281–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281void doClose(xsMachine *the, xsSlot *instance)
282{
283 TCP tcp = xsmcGetHostData(*instance);
284 if (tcp && xsmcGetHostDataValidate(*instance, (void *)&xsTCPHooks)) {
285 tcp->ready = false;
286
287 removeTCPCallbacks(tcp);
288 tcp->triggerable = 0;
289
290 xsmcSetHostData(*instance, NULL);
291 xsForget(tcp->obj);
292 xsmcSetHostDestructor(*instance, NULL);
293 atomic_set(&tcp->triggered, 0);
294 tcpRelease(tcp);
295 }
296}
297
298void xs_tcp_close(xsMachine *the)
299{

Callers 1

xs_tcp_closeFunction · 0.70

Calls 2

removeTCPCallbacksFunction · 0.70
tcpReleaseFunction · 0.70

Tested by

no test coverage detected