unixdgramclnt.lua 229 B

123456789
  1. socket = require"socket"
  2. socket.unix = require"socket.unix"
  3. c = assert(socket.unix.dgram())
  4. print(c:bind("/tmp/bar"))
  5. while 1 do
  6. local l = io.read("*l")
  7. assert(c:sendto(l, "/tmp/foo"))
  8. print(assert(c:receivefrom()))
  9. end