Shutdown server when no connections remain

This commit is contained in:
Tony Garnock-Jones 2014-05-04 15:55:00 -04:00
parent 461f0dfef5
commit 7abce613fa
1 changed files with 2 additions and 0 deletions

View File

@ -59,6 +59,8 @@
(close-input-port in)
(close-output-port out)
(set! connection-count (- connection-count 1))
(when (zero? connection-count)
(exit 0))
(transition s (quit))]
[(message (event _ (list line)) _ _)
(fprintf out "~a\n" line)