Created
July 20, 2012 22:22
-
-
Save yamasushi/3153651 to your computer and use it in GitHub Desktop.
http-getから入力ポートをつくりだすための試験場
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use rfc.http) | |
(define (dump-receiver) | |
(lambda (code hdrs total retr) | |
#?= code | |
#?= hdrs | |
(let loop [ ] | |
(receive (port size) (retr) | |
#?= port | |
#?= size | |
(cond | |
[ (eqv? size 0) #t] | |
[ (or (not size) (> size 0) ) | |
(debug-print (read-block size port)) | |
(loop) ]))))) | |
(define (main args) | |
(debug-print (http-get "www.google.com" "/" | |
:receiver (dump-receiver) ) ) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment