[Live-devel] Ignoring SIGPIPE

Ross Finlayson finlayson at live555.com
Fri Apr 20 17:35:07 PDT 2012


> Regarding the proposed change it work for me.
> Just one comment you may want to do something like that only
>> #ifdef USE_SIGNALS
>>     // Ignore the SIGPIPE signal, so that clients on the same host that are killed
>>     // don't also kill us:
>>   #ifdef SO_NOSIGPIPE
>>       int set_option = 1;
>>   setsockopt(ourSocket, SOL_SOCKET, SO_NOSIGPIPE, &set_option, sizeof set_option);
>>   #endif
>>   #endif
> 
> As the other portion of the code should be needed to be done only
> ounce at start of the app (and not everytime we create a socket).

The "#else" part of the code that I suggested - i.e., the line
	 signal(SIGPIPE, SIG_IGN);
was intended for those systems - if any - that don't define "SO_NOSIGPIPE" (but do define "SIGPIPE").  (Also, because this code will be executed in the "RTSPServer" constructor, it will usually be done only once per process, because most processes won't create more than one "RTSPServer" object.)

But anyway, I'll include this change in a future release of the software.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120421/050c3662/attachment.html>


More information about the live-devel mailing list