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

Function doClose

modules/io/socket/win/tcp.c:232–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void doClose(xsMachine *the, xsSlot *instance)
233{
234 TCP tcp = xsmcGetHostData(*instance);
235 if (tcp && xsmcGetHostDataValidate(*instance, (void *)&xsTCPHooks)) {
236 if (tcp->triggered)
237 tcpRelease(tcp);
238
239 tcp->done = 1;
240 tcp->triggerable = 0;
241 tcp->triggered = 0;
242
243 if (tcp->task) {
244 modTimerRemove(tcp->task);
245 tcp->task = NULL;
246 }
247
248 xsmcSetHostData(*instance, NULL);
249 xsForget(tcp->obj);
250 xsmcSetHostDestructor(*instance, NULL);
251 tcpRelease(tcp);
252 }
253}
254
255void xs_tcp_close(xsMachine *the)
256{

Callers 3

xs_tcp_constructorFunction · 0.70
xs_tcp_closeFunction · 0.70
templated.any.jsFile · 0.50

Calls 2

tcpReleaseFunction · 0.70
modTimerRemoveFunction · 0.50

Tested by

no test coverage detected