[racket] cp-write: error writing (Socket is not connected; errno=57)

From: Niitsuma Hirotaka (hirotaka.niitsuma at gmail.com)
Date: Sun Jan 16 06:44:53 EST 2011

I use racket for web crawling like the following code.
This code cause err :

cp-write: error writing (Socket is not connected; errno=57)

What's wrong in this code.
---------
#lang racket
(require net/url)

(define (http-get url-as-string)
  (let* ([out (open-output-string)]
         [in (get-pure-port (string->url url-as-string))])
    (copy-port in out)
    (close-input-port in)
    (get-output-string out)))

(do  ((n 1 (+ 1 n))) ( (= n  1000) n) (http-get "http://localhost/"))


Posted on the users mailing list.