luasocket/test/unixdgramclnt.lua

10 lines
229 B
Lua
Raw Normal View History

2016-06-24 15:23:00 +02:00
socket = require"socket"
socket.unix = require"socket.unix"
c = assert(socket.unix.dgram())
print(c:bind("/tmp/bar"))
2016-06-24 15:23:00 +02:00
while 1 do
local l = io.read("*l")
assert(c:sendto(l, "/tmp/foo"))
print(assert(c:receivefrom()))
end