File: unixdgramsrvr.lua

package info (click to toggle)
luasocket 3.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,264 kB
  • sloc: ansic: 4,845; makefile: 337; sh: 116
file content (9 lines) | stat: -rw-r--r-- 237 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
    socket = require"socket"
    socket.unix = require"socket.unix"
    u = assert(socket.unix.dgram())
    assert(u:bind("/tmp/foo"))
    while 1 do
		x, r = assert(u:receivefrom())
		print(x, r)
		assert(u:sendto(">" .. x, r))
    end