chuckremes / ffi-rzmq

FFI bindings for ZeroMQ so the library can be used under JRuby and other FFI-compliant ruby runtimes
242 stars 62 forks source link

context.terminate hangs #122

Closed smrt28 closed 7 years ago

smrt28 commented 7 years ago

There is nothing listening on localhost:42556. This code hangs in context.terminate:

require 'ffi-rzmq'
context = ::ZMQ::Context.new(1)
sender = context.socket(::ZMQ::REQ)
sender.setsockopt ::ZMQ::LINGER, 1
sender.setsockopt ::ZMQ::RCVTIMEO, 1000
sender.setsockopt ::ZMQ::SNDTIMEO, 1000
sender.connect 'tcp://localhost:42556'
context.terminate

35 - seems to be related, but old and closed

Linux 3.19.0-18-generic 18~14.04.1-Ubuntu SMP Wed May 20 09:38:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux] ffi-rzmq (2.0.4) ffi-rzmq-core (1.0.5)

chuckremes commented 7 years ago

This isn't a problem with ffi-rzmq. You are misusing the zeromq library. If you wrote the same code in C it would also hang.