websocket-sharp
websocket-sharp copied to clipboard
send("message") inside onopen() always fail
Using javascript to invoke a WSSharp server
var ws = new WebSocket("ws://localhost:5002/test");
ws.onopen = function () {
setTimeout(function () {
ws.send("Hello");
}, 1000);
};
The above code will fail if I do not wrap ws.send() with setTimeout()