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

https://stackoverflow.com/questions/108183/how-to-prevent-sigpipes-or-handle-them-properly

Â