MCPcopy Index your code
hub / github.com/witheve/Eve / initWebsocket

Function initWebsocket

src/runtime/server.ts:254–270  ·  view source on GitHub ↗
(wss, withIDE:boolean)

Source from the content-addressed store, hash-verified

252}
253
254function initWebsocket(wss, withIDE:boolean) {
255 wss.on('connection', function connection(ws) {
256 let client = new SocketRuntimeClient(ws, withIDE);
257 let handler = withIDE ? IDEMessageHandler : MessageHandler;
258 if(!withIDE) {
259 // we need to initialize
260 }
261 ws.on('message', (message) => {
262 handler(client, message);
263 })
264 ws.on("close", function() {
265 if(client.evaluation) {
266 client.evaluation.close();
267 }
268 });
269 });
270}
271
272//---------------------------------------------------------------------
273// Go!

Callers 1

runFunction · 0.85

Calls 2

onMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected