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

Does not close socket on ETERM #22

Closed
moteus opened this issue Nov 20, 2014 · 0 comments · Fixed by #23
Closed

Does not close socket on ETERM #22

moteus opened this issue Nov 20, 2014 · 0 comments · Fixed by #23

Comments

@moteus
Copy link
Member

moteus commented Nov 20, 2014

Now if socket detect ETERM it close himself immediately.
This is not very convinient on multithread code.

-- Worker thread
while true do
  local ok, err = sok:recvx()
  if not ok then break end
end
cleanup()
-- main thread

-- srart worker thread
-- wait
ctx:destroy()

In this example sok will get ETERM just after ctx:destroy() and close himself.
After thet ctx:destroy() will be ended main thread also ended.
So cleanup may be not called.

Now lzmq context close all sockets by default so I think it compatiable with preview version excapt this case.

moteus added a commit that referenced this issue Nov 26, 2014
Change. Sockets does not close when they detects ETERM.
Close #22
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 a pull request may close this issue.

1 participant