You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local cons = luv.fiber.create(function()
local sub = zmq:socket(luv.zmq.PULL)
sub:connect('tcp://127.0.0.1:1234')
-- local pub = zmq:socket(luv.zmq.PUB)
-- pub:bind('tcp://127.0.0.1:1235')
local pub = zmq:socket(luv.zmq.PUSH)
pub:bind('tcp://127.0.0.1:1235')
print("enter cons")
while true do
print('xxxxxx')
local msg = sub:recv()
print('yyyyyyxxxxxx')
-- require('posix').sleep(1)
if msg then
print(msg)
--pub:send('haha, I have receive your request '.. msg)
--pub:send(msg)
-- pub:send('I like you '..math.random())
end
--luv.sleep(1)
end
sub:close()
pub:close()
end)
cons:ready()
cons:join()
The text was updated successfully, but these errors were encountered:
local luv = require('luv')
local zmq = luv.zmq.create(2)
local cons = luv.fiber.create(function()
local sub = zmq:socket(luv.zmq.PULL)
sub:connect('tcp://127.0.0.1:1234')
print('xxxxxx')
local msg = sub:recv()
print('yyyyyyxxxxxx')
-- require('posix').sleep(1)
if msg then
print(msg)
--pub:send('haha, I have receive your request '.. msg)
--pub:send(msg)
-- pub:send('I like you '..math.random())
end
--luv.sleep(1)
end
sub:close()
pub:close()
end)
cons:ready()
cons:join()
The text was updated successfully, but these errors were encountered: