Update fetchurl.rkt for prospect-monolithic.

This commit is contained in:
Tony Garnock-Jones 2016-01-27 22:15:14 -05:00
parent 594add5939
commit 265eee348a
1 changed files with 15 additions and 13 deletions

View File

@ -27,21 +27,23 @@
(spawn (lambda (e seen-peer?) (spawn (lambda (e seen-peer?)
(match e (match e
[(routing-update g) [(scn g)
(define peer-present? (not (gestalt-empty? g))) (define peer-present? (trie-non-empty? g))
(transition (or seen-peer? peer-present?) (if (and (not peer-present?) seen-peer?)
(if (and (not peer-present?) seen-peer?) (begin (printf "URL fetcher exiting.\n")
(quit) (quit))
(send (tcp-channel (transition (or seen-peer? peer-present?)
local-handle (message
remote-handle (tcp-channel
#"GET / HTTP/1.0\r\nHost: stockholm.ccs.neu.edu\r\n\r\n"))))] local-handle
[(message (tcp-channel _ _ bs) _ _) remote-handle
#"GET / HTTP/1.0\r\nHost: stockholm.ccs.neu.edu\r\n\r\n"))))]
[(message (tcp-channel _ _ bs))
(printf "----------------------------------------\n~a\n" bs) (printf "----------------------------------------\n~a\n" bs)
(printf "----------------------------------------\n") (printf "----------------------------------------\n")
#f] #f]
[_ #f])) [_ #f]))
#f #f
(gestalt-union (pub (tcp-channel local-handle remote-handle ?)) (scn/union (advertisement (tcp-channel local-handle remote-handle ?))
(sub (tcp-channel remote-handle local-handle ?)) (subscription (tcp-channel remote-handle local-handle ?))
(sub (tcp-channel remote-handle local-handle ?) #:level 1)))) (subscription (advertise (tcp-channel remote-handle local-handle ?))))))