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