Make distributed/tcp-server respect TcpListenError

This commit is contained in:
Tony Garnock-Jones 2021-06-17 13:43:01 +02:00
parent ac8ea67ab1
commit 373fb77fc3
1 changed files with 3 additions and 1 deletions

View File

@ -26,8 +26,10 @@
(spawn-tcp-driver ds)
(spawn #:name 'tcp-server
(define spec (TcpLocal "0.0.0.0" 5999))
(at ds
(during/spawn (StreamConnection $source $sink (TcpLocal "0.0.0.0" 5999))
(stop-on (asserted (TcpListenError spec _)))
(during/spawn (StreamConnection $source $sink spec)
#:name (list 'tcp-server source)
(run-relay #:packet-writer (lambda (bs) (send-data sink bs))
#:setup-inputs