MCPcopy
hub / github.com/pyodide/pyodide / close

Function close

src/js/fs/nodesockfs.ts:321–338  ·  view source on GitHub ↗
(sock: NodeSock)

Source from the content-addressed store, hash-verified

319 },
320
321 close(sock: NodeSock): number {
322 // Signal the pump to stop before touching the reader.
323 sock.closed = true;
324 notifyDataAvailable(sock);
325 maybeResumePump(sock);
326
327 if (sock.wcgSocket) {
328 sock.reader = null;
329 sock.writer = null;
330 sock.wcgSocket.close().catch(() => {});
331 sock.wcgSocket = null;
332 }
333 sock.recvBuffer = [];
334 sock.recvBufferBytes = 0;
335 sock.connected = false;
336 sock.connecting = false;
337 return 0;
338 },
339
340 async connectAsync(
341 sock: NodeSock,

Callers 2

test_fs_dupFunction · 0.85
test_nativefs_dupFunction · 0.85

Calls 4

notifyDataAvailableFunction · 0.85
maybeResumePumpFunction · 0.85
catchMethod · 0.45
closeMethod · 0.45

Tested by 2

test_fs_dupFunction · 0.68
test_nativefs_dupFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…