From 6c98531832240817fd22a28e7bcf19a4164e0147 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 27 Jan 2016 21:51:51 -0500 Subject: [PATCH] Enable "webserver" --- main.rkt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/main.rkt b/main.rkt index 9d7828c..4ab737c 100644 --- a/main.rkt +++ b/main.rkt @@ -80,10 +80,10 @@ (void) (scn (subscription (udp-packet ? (udp-listener 6667) ?))))) -#;(let () +(let () (define (spawn-session them us) (list - (send 'bump) + (message 'bump) (spawn (lambda (e s) (match e [(message `(counter ,counter)) @@ -97,8 +97,7 @@ "TCP/IP stack.

\n" "

There have been ~a requests prior to this one.

") counter))) - (transition s (list (message #:meta-level 1 (tcp-channel us them response)) - (quit)))] + (quit (message (at-meta (tcp-channel us them response))))] [_ #f])) (void) (scn/union (subscription `(counter ,?)) @@ -106,11 +105,11 @@ (subscription (advertise (tcp-channel them us ?)) #:meta-level 1) (advertisement (tcp-channel us them ?) #:meta-level 1))))) - (spawn-world + (spawn-network (spawn (lambda (e counter) (match e - [(message 'bump _ _) - (transition (+ counter 1) (send `(counter ,counter)))] + [(message 'bump) + (transition (+ counter 1) (message `(counter ,counter)))] [_ #f])) 0 (scn (subscription 'bump)))