diff --git a/test/testsrvr.lua b/test/testsrvr.lua index f1972c2..4be4069 100644 --- a/test/testsrvr.lua +++ b/test/testsrvr.lua @@ -7,7 +7,12 @@ while 1 do print("server: waiting for client connection..."); control = assert(server:accept()); while 1 do - command = assert(control:receive()); + command, emsg = control:receive(); + if emsg == "closed" then + control:close() + break + end + assert(command, emsg) assert(control:send(ack)); print(command); (loadstring(command))();