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

Function xs_tcp_destructor

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

Source from the content-addressed store, hash-verified

210}
211
212void xs_tcp_destructor(void *data)
213{
214 TCP tcp = data;
215 if (!tcp) return;
216
217 if (tcp->task) {
218 modTimerRemove(tcp->task);
219 tcp->task = NULL;
220 }
221
222 if (tcp->skt >= 0) {
223 closesocket(tcp->skt);
224 tcp->skt = INVALID_SOCKET;
225 }
226
227 free(tcp);
228
229 modInstrumentationAdjust(NetworkSockets, -1);
230}
231
232void doClose(xsMachine *the, xsSlot *instance)
233{

Callers 1

tcpReleaseFunction · 0.70

Calls 1

modTimerRemoveFunction · 0.50

Tested by

no test coverage detected