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

From: Noel Welsh (noelwelsh at gmail.com)
Date: Mon Jan 17 09:56:21 EST 2011

I don't know for sure, but it could be you are running out of sockets
on your local machine. In my experience it seems to take some time for
the OS to recycle a socket. Try adding a delay to the loop.

HTH,
N.

On Sun, Jan 16, 2011 at 11:44 AM, Niitsuma Hirotaka
<hirotaka.niitsuma at gmail.com> wrote:
> 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/"))
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>


Posted on the users mailing list.