Skip to content

On :disconnect not working #19

@jlatko

Description

@jlatko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions