Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ws.on :close not always triggered #24

Open
rubys opened this issue Sep 28, 2016 · 2 comments
Open

ws.on :close not always triggered #24

rubys opened this issue Sep 28, 2016 · 2 comments

Comments

@rubys
Copy link

rubys commented Sep 28, 2016

I've found two cases where ws.on :close is not triggered, both involving the server going down. First is with a em-websocket server, and the second is with a secure: true connection with a WebSocket-EventMachine-Server server.

A possible fix is to replace sleep 1 with close in client.rb.

To reproduce, use the websocket-client-simple example with either the em-websocket example or with the WebSocket-EventMachine-Server example modified for TLS.

@rubys
Copy link
Author

rubys commented Oct 16, 2016

Monkey patch for those encountering this issue:

class WebSocket::Client::Simple::Client
  def sleep(*args)
    close
  end
end

@unasuke
Copy link
Contributor

unasuke commented Dec 30, 2021

@rubys This repository was moved ruby-jp/websocket-client-simple. If you still need this, make pull request or issue to ruby-jp/websocket-client-simple again, thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants