lib1256 / lua-zmq

Lua 5.3 binding of ZeroMQ 4.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Lua 5.3 binding of ZeroMQ 4.0

License:Apache License 2.0


Languages

Language:C 84.5%Language:Lua 14.4%Language:Shell 1.2%