autobahn-js icon indicating copy to clipboard operation
autobahn-js copied to clipboard

WebSocket is not open error when WAMP server shutdown without waiting for reply

Open akiroz opened this issue 6 years ago • 0 comments

When the WAMP server shutdown with GOODBYE and closes the connection. AutobahnJS will try to echo the message on a closing/closed websocket crashing the program.

/.../node_modules/ws/lib/websocket.js:314
      const err = new Error(
                  ^
Error: WebSocket is not open: readyState 2 (CLOSING)
    at WebSocket.send (/.../node_modules/ws/lib/websocket.js:314:19)
    at Object.transport.send (/.../node_modules/autobahn/lib/transport/websocket.js:117:23)
    at Session.self._send_wamp (/.../node_modules/autobahn/lib/session.js:279:20)
    at Object.Session.self._socket.onmessage (/.../node_modules/autobahn/lib/session.js:972:21)
    at WebSocket.<anonymous> (/.../node_modules/autobahn/lib/transport/websocket.js:140:23)
    at WebSocket.emit (events.js:182:13)
    at WebSocket.EventEmitter.emit (domain.js:442:20)
    at Receiver.receiverOnMessage (/.../node_modules/ws/lib/websocket.js:719:20)
    at Receiver.emit (events.js:182:13)
    at Receiver.EventEmitter.emit (domain.js:442:20)
error Command failed with exit code 1.

akiroz avatar Sep 17 '18 09:09 akiroz