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

When polling and the context is terminated, don't throw ZError.IOException #390

Merged
merged 1 commit into from
Dec 6, 2016

Conversation

daveyarwood
Copy link
Contributor

This should fix #380 (Destroying a context while polling causes java.nio.channels.ClosedChannelException).

Summary of changes in this PR:

  • When a Poller is created via a context (which is the recommended way to do it; see Allow ZMQ.Context / ZContext to manage closing poll selectors #386), poller.context is set to that context so the poller has a reference to it.

  • When poll results in a ClosedChannelException or any other ZError.IOException, we check to see if the context is terminated, and if so, we catch the exception and return 0.

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

Successfully merging this pull request may close these issues.

Destroying a context while polling causes java.nio.channels.ClosedChannelException
2 participants