MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / allocSocket

Function allocSocket

host/network/src/main/state.js:8–8  ·  view source on GitHub ↗
(ws)

Source from the content-addressed store, hash-verified

6 const sseSources = []; // EventSource per sse_open; nulled on close.
7
8 const allocSocket = (ws) => { sockets.push(ws); return sockets.length - 1; };
9 const socket = (h) => {
10 if (h < 0 || h >= sockets.length || sockets[h] === null) {
11 throw new Error('invalid socket handle: ' + h);

Callers 1

ws.jsFile · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected