On Mon, Sep 23, 2002 at 04:34:18PM +0300, Vladimir Terziev wrote:
> 
>       Hi hackers,
> 
>       I'm implementing a programmme, which writes a big amount of data (using 
>write(2)) to a socket.
>       When the communication stream has been closed by some reason, during the 
>write(2) call, my process receives SIGPIPE. I tryed to catch it with signal(3) and 
>change the behaviour of write(2) call with siginterrupt(3), but SIGPIPE is still 
>raised to my process and terminates it.
> 
>       Any help and ideas will be useful!

You should receive a short write(2) before the SIGPIPE is sent, most
probably a write() which returns -1 and sets errno to, say, ECONNRESET
or something like that.  Are you sure *all* your previous writes return
as many bytes as you have tried to write?

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED]        [EMAIL PROTECTED]
PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
If I were you, who would be reading this sentence?

Attachment: msg36996/pgp00000.pgp
Description: PGP signature

Reply via email to