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?)
(match e
[(routing-update g)
(define peer-present? (not (gestalt-empty? g)))
(transition (or seen-peer? peer-present?)
(if (and (not peer-present?) seen-peer?)
(quit)
(send (tcp-channel
local-handle
remote-handle
#"GET / HTTP/1.0\r\nHost: stockholm.ccs.neu.edu\r\n\r\n"))))]
[(message (tcp-channel _ _ bs) _ _)
[(scn g)
(define peer-present? (trie-non-empty? g))
(if (and (not peer-present?) seen-peer?)
(begin (printf "URL fetcher exiting.\n")
(quit))
(transition (or seen-peer? peer-present?)
(message
(tcp-channel
local-handle
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")
#f]
[_ #f]))
#f
(gestalt-union (pub (tcp-channel local-handle remote-handle ?))
(sub (tcp-channel remote-handle local-handle ?))
(sub (tcp-channel remote-handle local-handle ?) #:level 1))))
(scn/union (advertisement (tcp-channel local-handle remote-handle ?))
(subscription (tcp-channel remote-handle local-handle ?))
(subscription (advertise (tcp-channel remote-handle local-handle ?))))))