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

10 lines
220 B
Lua

socket = require"socket"
socket.unix = require"socket.unix"
c = assert(socket.unix.udp())
c:bind("/tmp/bar")
while 1 do
local l = io.read("*l")
assert(c:sendto(l, "/tmp/foo"))
print(assert(c:receivefrom()))
end