Neopallium / lua-zmq

Lua zeromq2 binding
http://github.com/Neopallium/lua-zmq
MIT License
153 stars 36 forks source link

socket:recv() does not work #21

Closed mkottman closed 12 years ago

mkottman commented 12 years ago

The method socket:recv() does not work - it just returns false instead of the string I send. Consider this example:

local zmq = require 'zmq'
local ctx = zmq.init(1)

local r = assert(ctx:socket(zmq.PAIR))
assert(r:bind('inproc://test'))

local s = assert(ctx:socket(zmq.PAIR))
assert(s:connect('inproc://test'))

assert(s:send("hello"))
print(r:recv()) -- expecting "hello", got: false

I use lua-zmq from git HEAD and ZMQ 3.1.1. Note that the send_msg and recv_msg do work as expected, but it cost me a lot of time to find it out :)

Neopallium commented 12 years ago

Thanks for the report. Fixed pushed. It should work now with 3.1 I haven't tested the fix with 3.1, don't have that version installed right now.

mkottman commented 12 years ago

Thanks, I have tried it and it now works as expected.