2007-04-09 22:04:13 +00:00
|
|
|
socket = require"socket"
|
|
|
|
socket.unix = require"socket.unix"
|
2016-06-24 21:23:00 +08:00
|
|
|
u = assert(socket.unix.udp())
|
2007-04-09 22:04:13 +00:00
|
|
|
assert(u:bind("/tmp/foo"))
|
|
|
|
while 1 do
|
2016-06-24 21:23:00 +08:00
|
|
|
x, r = assert(u:receivefrom())
|
|
|
|
print(x, r)
|
|
|
|
assert(u:sendto(">" .. x, r))
|
2007-04-09 22:04:13 +00:00
|
|
|
end
|