I am getting an error about:
Failed to execute 'send' on 'WebSocket': Still in CONNECTING state. Is there an event I can check to make sure the socket is fully connected before I can send a message.
My code is as follows:
this.contextWS = new WebSocket(socketAddress);
this.contextWS.onopen = () => {
console.log('Websocket is open !!!');
this.contextWS.send('payload');
}
Am I making an obvious mistake here?