unixstreamsrvr.lua 244 B

123456789
  1. socket = require"socket"
  2. socket.unix = require"socket.unix"
  3. u = assert(socket.unix.stream())
  4. assert(u:bind("/tmp/foo"))
  5. assert(u:listen())
  6. c = assert(u:accept())
  7. while 1 do
  8. print(assert(c:receive()))
  9. end