/lua-zmq

Lua 5.3 binding of ZeroMQ 4.0

Primary LanguageCApache License 2.0Apache-2.0

lua-zmq

lua-zmq is a simple(but not complete) Lua 5.3 binding of ZeroMQ 4.x

Installation

First obtain premake5.

Build on Windows 7 x64

  1. Type premake5 vs2013 on command window to generate MSVC solution files.
  2. Use Visual Studio 2013(either Ultimate or Community version) to compile executable binaries.

Build on Ubuntu 14.04 64-bit

  1. Type ./build_deps.sh to install libzmq and libsolidum
  2. Type premake5 gmake && make config=release_x64

Usage at a glance

local zmq = require 'luazmq'
zmq.init()

local c = zmq.socket(zmq.REQ)
c.set_identity('node002')
while true do
    c.send('hello')
    local rep = c.recv()
    print(rep)
end

zmq.shutdown()
zmq.terminate()

See more exampes and API doc