luasocket/test/unixdgramsrvr.lua

10 lines
237 B
Lua
Raw Normal View History

2007-04-10 00:04:13 +02:00
socket = require"socket"
socket.unix = require"socket.unix"
u = assert(socket.unix.dgram())
2007-04-10 00:04:13 +02:00
assert(u:bind("/tmp/foo"))
while 1 do
2016-06-24 15:23:00 +02:00
x, r = assert(u:receivefrom())
print(x, r)
assert(u:sendto(">" .. x, r))
2007-04-10 00:04:13 +02:00
end