[zeromq-dev] Ruby bindings - setsockopt problems

Martin Sustrik sustrik at 250bpm.com
Sat Apr 10 16:53:37 CEST 2010


Hi Wolfgang,

> 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).

Fixed. Try the current version of rbzmq.

Martin



More information about the zeromq-dev mailing list