mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-21 00:09:51 +02:00
Import IPv6-supported Lua5.2 compatible code from Matthew Wild's repo
Signed-off-by: Vadim A. Misbakh-Soloviov <mva@mva.name>
This commit is contained in:
15
test/testsrvr.lua
Normal file
15
test/testsrvr.lua
Normal file
@ -0,0 +1,15 @@
|
||||
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 or load)(command))();
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user