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

Function doClose

modules/io/socket/lin/tcp.c:239–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

xs_tcp_constructorFunction · 0.70
xs_tcp_closeFunction · 0.70

Calls 2

tcpReleaseFunction · 0.70
modTimerRemoveFunction · 0.50

Tested by

no test coverage detected