testsrvr asserts when test finishes successfully.

When the test client finishes, the test server asserts with a "closed" message.
After looking carefully at this, I think the tests are running
successfully and passing. Since it appears to be a test failure, I
modified the server to allow the client to close the control connection.
This commit is contained in:
Sam Roberts 2011-08-08 16:23:06 -07:00
parent dace50628c
commit 3b19f2a7ed

View File

@ -7,7 +7,12 @@ while 1 do
print("server: waiting for client connection..."); print("server: waiting for client connection...");
control = assert(server:accept()); control = assert(server:accept());
while 1 do 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)); assert(control:send(ack));
print(command); print(command);
(loadstring(command))(); (loadstring(command))();