1
0
mirror of https://github.com/minetest-mods/irc.git synced 2024-12-28 01:30:21 +01:00
irc/etc/tests/luasocket/testsrvr.lua

16 lines
403 B
Lua
Raw Normal View History

2012-12-01 04:06:15 +01:00
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));
print(command);
(loadstring(command))();
end
end