(h)
| 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); |
| 12 | } |
| 13 | return sockets[h]; |
| 14 | }; |
| 15 | |
| 16 | const allocSse = (es) => { sseSources.push(es); return sseSources.length - 1; }; |
| 17 | const sse = (h) => { |