We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try this, connect to localhost:8080, and then disconnect. Memory usage grows rapidly.
console.log("Connected to Wifi"); var page = '<html><body><script>var ws;setTimeout(function(){'; page += 'ws = new WebSocket("ws://" + location.host + "/my_websocket", "protocolOne");'; page += 'ws.onmessage = function (event) { console.log("MSG:"+event.data); };'; page += 'setTimeout(function() { ws.send("Hello to Espruino!"); }, 2000);'; page += '},2000);</script></body></html>'; var onPageRequest = function(req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.end(page); }; var server = require('ws').createServer(onPageRequest); server.listen(8000); server.on("websocket", function(ws) { var count = 0; console.log("Connection upgraded"); ws.on('message',function(msg) { console.log("Message received"); print("[WS] "+JSON.stringify(msg)); }); /* ws.on('close',function(msg) { if (intr) clearInterval(intr); });*/ var intr = setInterval(function() { ws.send("Hello "+count++); }, 100); }); setInterval(function() { console.log("Memory usage:", process.memory().usage); }, 1000);
We should probably just throw an exception.
The text was updated successfully, but these errors were encountered:
e8d83bf
No branches or pull requests
Try this, connect to localhost:8080, and then disconnect. Memory usage grows rapidly.
We should probably just throw an exception.
The text was updated successfully, but these errors were encountered: