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

Question: <socket>.identity= under LibZMQ.version3? #79

Closed mistergibson closed 11 years ago

mistergibson commented 11 years ago

Regarding: https://github.com/chuckremes/ffi-rzmq/blob/master/lib/ffi-rzmq/socket.rb Line 535

I understand that LibZMQ version 3 uses unsigned 16-bit integer for identity instead of a uuid-as-string. Should this line be altered to cast .to_i, or does it pack in a string (of numerals) of the integer? Some clarification would be appreciated.

Thanks

chuckremes commented 11 years ago

0mq uses an integer for its internally-generated identities only. The man page says that you can override the identity with your own identity up to 255 bytes long. In Ruby, dealing with strings is far easier than dealing with packed bytes.

On Feb 5, 2013, at 4:50 PM, mistergibson notifications@github.com wrote:

Regarding: https://github.com/chuckremes/ffi-rzmq/blob/master/lib/ffi-rzmq/socket.rb Line 535

I understand that LibZMQ version 3 uses unsigned 16-bit integer for identity instead of a uuid-as-string. Should this line be altered to cast .to_i, or does it pack in a string (of numerals) of the integer? Some clarification would be appreciated.

Thanks

— Reply to this email directly or view it on GitHub.