I am very new to NodeJS
and Websockets
, but i am trying to play with it.
What i do is read incoming datas from Serial port, then send these dat
Try this while sending data to client: - socket is my current web socket object.It overwrites the default >WebSocket.js class condition that throws "not-opened error".
if (socket.readyState != socket.OPEN) {
console.error('Client state is ' + socket.readyState);
//or any message you want
} else {
socket.send(JSON.stringify(object)); //send data to client
}