[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: How to recognize unfriendly closing of network connections?
From:       Thiago Macieira <thiagom () wanadoo ! fr>
Date:       2002-01-26 20:19:03
[Download RAW message or body]

Mirko Boehm wrote
>When a network connection is closed in a controlled manner, I can take
>care of closing the other end by means of the protocol, for example. But
>what if the program holding the connection exits because of a seg fault,
>for example? When I send data to the connection, I will receive a
>SIG_PIPE. But I would like to receive a notice as soon as the program is
>killed.

I think you receive SIGPIPE only on pipes and FIFOs. On sockets, you'd get a 
read or write error and errno would be set to the reason, like ECONNRESET 
(Connection reset by peer).

I could be speaking nonsense here, though. And it might vary from OS to OS.
-- 
  Thiago Macieira - UFOT Registry number: 1001
 thiagom@mail.com
   ICQ UIN: 1967141  PGP: 0x8F2978D5 and 0xEA9037A5 (PGP 2.x)
     Registered Linux user #65028

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic