chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] tcp-connect doesn't correctly signal errors


From: John.Cowan
Subject: Re: [Chicken-users] tcp-connect doesn't correctly signal errors
Date: Wed, 14 Sep 2005 21:50:46 -0400
User-agent: Mutt/1.4.2.1i

Michael Benfield scripsit:

> $ csi -q
> #;1> (require 'tcp)
> #;2> (define-values (i o) (tcp-connect "slashdot.org" 12345))
> #;3> (write 5 o)
> Broken pipe

That is the documented behavior, at least under Unix.  From write(2):

     EPIPE An attempt is made to write to a pipe or a  FIFO  that
           is  not  open  for reading by any process, or that has
           only one end open (or to a file descriptor created  by
           socket(3SOCKET),  using  type  SOCK_STREAM  that is no
           longer connected to a peer endpoint). A SIGPIPE signal
           will  also  be  sent to the process.  The process dies
           unless special  provisions  were  taken  to  catch  or
           ignore the signal.

It is a by-product of pipes being implemented as socket pairs.

-- 
John Cowan  address@hidden  www.reutershealth.com  www.ccil.org/~cowan
        Sound change operates regularly to produce irregularities;
        analogy operates irregularly to produce regularities.
                --E.H. Sturtevant, ca. 1945, probably at Yale




reply via email to

[Prev in Thread] Current Thread [Next in Thread]