Directly detect incoming connections in examples/chat-simplified-internals

This commit is contained in:
Tony Garnock-Jones 2016-01-16 22:12:35 -05:00
parent 024157103c
commit ad9a78b4a4
1 changed files with 10 additions and 3 deletions

View File

@ -70,6 +70,13 @@
(observe (tcp-channel (?!) (?! (tcp-listener 5999)) ?))
tcp-proxy-process)
(spawn-demand-matcher (tcp-remote-open (?!))
(tcp-local-open (?!))
spawn-session)
(spawn (lambda (e s)
(if (patch? e)
(transition s
(for/list [(id (matcher-project/set/single
(patch-added e)
(compile-projection (tcp-remote-open (?!)))))]
(spawn-session id)))
#f))
(void)
(sub (tcp-remote-open ?)))