luasocket/test/unixtcpsrvr.lua
2016-06-24 21:33:19 +08:00

10 lines
241 B
Lua

socket = require"socket"
socket.unix = require"socket.unix"
u = assert(socket.unix.tcp())
assert(u:bind("/tmp/foo"))
assert(u:listen())
c = assert(u:accept())
while 1 do
print(assert(c:receive()))
end