Add "timeout" command.

This commit is contained in:
2020-05-19 12:28:49 +02:00
parent 2a5c7ba463
commit 11fcf0cfc2
4 changed files with 22 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ proc closeServer*() =
## Sends a "Close" command to the server
var socket = newSocket()
socket.connect("127.0.0.1", Port(defaultPort))
let c = newCommand(Command.Close)
let c = newCommand(cClose)
socket.send(c.wrap)
socket.close()
@@ -32,7 +32,7 @@ proc runServer*() =
var jsonData = parseJson(line)
let msg = jsonData.to(CommandMessage)
case msg.command
of Command.Close:
of cClose:
echo "Server recieved termination command. Exiting."
break
else: