[zeromq-dev] Ruby bindings - setsockopt problems

Wolfgang Barth wob at swobspace.de
Sat Apr 10 15:18:51 CEST 2010


I'm playing a little bit around with some socket options in Ruby:

ctx = ZMQ::Context.new(1, 1, 0)
s = ctx.socket(ZMQ::PUB);
s.setsockopt(ZMQ::IDENTITY, "wob")
String based socket options are working, but all others not, i.e.:

s.setsockopt(ZMQ::HWM, 2)
s.setsockopt(ZMQ::LWM, 1)
s.setsockopt(ZMQ::SWAP, 1024)

I get always an error:

./prompt.rb:15:in `setsockopt': Invalid argument (RuntimeError)
        from ./prompt.rb:15

The numeric socket options are separate called from the string based
options in rbzmq.cpp::socket_setsockopt, may be there is a number
conversion problem? (I'm not a C++ programmer, can't find the issue).

<wob (at) swobspace de> * http://www.swobspace.de

More information about the zeromq-dev mailing list