luasocket/test/unixudpsrvr.lua
2016-06-24 21:33:19 +08:00

10 lines
235 B
Lua

socket = require"socket"
socket.unix = require"socket.unix"
u = assert(socket.unix.udp())
assert(u:bind("/tmp/foo"))
while 1 do
x, r = assert(u:receivefrom())
print(x, r)
assert(u:sendto(">" .. x, r))
end