From f8177ff97d77e29fa52ed55fb340fc63af90001f Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 13 Jul 2020 16:38:42 -0400 Subject: Add readme Add a readme with a usage example --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..188af88 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# lua-nng + +This is a simple binding of [Nanomessage Next Generation](https://github.com/nanomsg/nng) to lua. + +## Installation + +The easiest way to download lua-nng is with [luarocks](https://github.com/luarocks/luarocks) + +``` +luarocks install --server=http://rocks.cogarr.net lua-nng +``` + +## Example + + local s1 = nng.pair1_open() + local s2 = nng.pair1_open() + + s1:listen("ipc:///tmp/pair.ipc") + s2:dial("ipc://tmp/pair.ipc") + + s2:send("hello") + print(s1:recv()) + +prints "hello" + +For more examples, see sepc/start\_spec.lua + -- cgit v1.2.3-70-g09d2