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

One terminated client connection causes other clients to terminate #89

Closed
neilberkman opened this issue Feb 9, 2016 · 3 comments
Closed

Comments

@neilberkman
Copy link

I'm encountering something that may or may not be indicative of an underlying issue in faye-websocket-ruby. I'll describe the situation in case it's obvious that I'm doing something wrong. If not I can try to come up with a self-contained test case.

Here's the situation: I've created a monitoring tool that needs to establish websocket connections to multiple servers. The monitor for each server consists of a Faye::WebSocket::Client within an EventMachine reactor. The issue is that if a websocket server dies, the websockets for all of the other monitors are closed as well. This isn't the case if I just terminate a specific websocket from within my monitoring tool.

If you think this may indicate an issue in faye-websocket-ruby, let me know and I'll extract my code out and also create a server that can be used to reproduce. And if I'm doing something obviously wrong, I'd really appreciate it if you could give me some guidance. Thanks!

Update: to be more concise, I guess I should just ask: should it be possible to run multiple faye-websocket-ruby clients within a single ruby process? Thanks.

@jcoglan
Copy link
Collaborator

jcoglan commented Feb 11, 2016

The most likely cause of this is that EventMachine is being stopped when one client disconnects. Within this library, socket instances do not sure any state, the only thing they share is that they need EventMachine to be running at all times.

@neilberkman
Copy link
Author

Hmm, I'm not explicitly calling EM.stop. I ended up taking another approach to the problem I'm trying to solve. I'll just close this out since it's likely that the issue was due to something on my end.

@shashiprab
Copy link

I'm having a similar problem when running with passenger. How do I ensure EM is running always. I too don't call EM.stop - any insights or solutions?

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

3 participants