aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 3c5bd9a451cb926f8f58f8ed095d7aa04973ef8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 nng = require("nng")

	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 spec/start\_spec.lua