blob: f7be1962a81a432495fcc788d67cdb5dca5d6d10 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
require("socket");
os.remove("/tmp/luasocket")
socket = require("socket.unix");
host = "luasocket";
server = socket.unix()
print(server:bind(host))
print(server:listen(5))
ack = "\n";
while 1 do
print("server: waiting for client connection...");
control = assert(server:accept());
while 1 do
command = assert(control:receive());
assert(control:send(ack));
(loadstring(command))();
end
end
|