Socket.on :disconnect is not triggering, when I kill node server. I tried to debug it and after a few seconds socket.open? returns false, but socket.state is still 'connect'. I noticed that the line
return unless @state == :connect
in emit method makes it impossible to emit :disconnect after changing state to :disconnect (which happens in every case). Also the line
return unless open?
might be causing problems for example here:
if @websocket.open? and Time.now.to_i - @last_pong_at > @ping_timeout/1000 @websocket.close @state = :disconnect __emit :disconnect reconnect end
Socket.on :disconnect is not triggering, when I kill node server. I tried to debug it and after a few seconds
socket.open?returns false, butsocket.stateis still 'connect'. I noticed that the linereturn unless @state == :connectin emit method makes it impossible to emit :disconnect after changing state to :disconnect (which happens in every case). Also the line
return unless open?might be causing problems for example here:
if @websocket.open? and Time.now.to_i - @last_pong_at > @ping_timeout/1000 @websocket.close @state = :disconnect __emit :disconnect reconnect end