[Asterisk-Dev] seeking advise on sigpipe in app_

Freddi Hansen fh at danovation.dk
Mon Jan 5 06:44:37 MST 2004

I have made a modified version of cdr_csv which has an additional option 
for logging the csv_cdr to <hostname:port>.
We need this function as part of site where we run multiple * behind 2 

Most of my programming experience are from Solaris so please correct me 
if I am off-track
If the tcp connection is lost then I would assume that I get a sigpipe 
on either write or flush using
the defunct connection handle. This would lead me to re-establish the 
connection and continue.
( a non-blocking read from the pipe would normally on Solaris return an 
EOF if the connection is lost
but the sigpipe does still showup first sometimes under load).

My issue is:  if an * application needs to catch a sigpipe is there a 
some way the application
is supposed to getit (other than just setup a handler and maybe get 
another applications sigpipe)
Reading from Linux man pages says that there is no control over which 
thread is active when the
signal is issued, so even just enabling sigpipe around my write/flush 
can't be considered safe.
Any suggestion is welcome.

More information about the asterisk-dev mailing list