luasocket/test/unixudpclnt.lua

10 lines
220 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.udp())
c:bind("/tmp/bar")
while 1 do
local l = io.read("*l")
assert(c:sendto(l, "/tmp/foo"))
print(assert(c:receivefrom()))
end