/
Disabling SIGPIPE

Disabling SIGPIPE

This little snippet seems like the best way to stop legacy behavior of sockets on POSIX operating systems raising a SIGPIP signal if you write to disconnected socket or pipe.

signal(SIGPIPE, SIG_IGN);

See

How to prevent SIGPIPEs (or handle them properly)

 

Related content

Disabling the Nagle Algorithm is a good idea
Disabling the Nagle Algorithm is a good idea
More like this
A brief history of sockets
A brief history of sockets
More like this
The socket C10K problem
The socket C10K problem
More like this
Windows sockets need to be enabled
Windows sockets need to be enabled
More like this
Implementing a event loop - how do you handle timers?
Implementing a event loop - how do you handle timers?
Read with this
Make the abstraction layer as minimal as possible
Make the abstraction layer as minimal as possible
More like this