aboutsummaryrefslogtreecommitdiff
path: root/test/testsrvr.lua
blob: 2408e83229ad0721f229f1a5aabf94174ddc606f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
socket = require("socket");
host = host or "localhost";
port = port or "8383";
server = assert(socket.bind(host, port));
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