Portable handle SIGPIPE on failed write to a remote closed network socket. More...
#include <connection_common.hpp>
Portable handle SIGPIPE on failed write to a remote closed network socket.
This is a general solution, for when you are not in full control of the program’s signal handling and want to write data to an actual pipe or use write(2) on a socket. To control SIGPIPE on send(2) There can be used option MSG_NOSIGNAL on Linux and SO_NOSIGPIPE on MacOS. But with SSL function calls we have to use this class because it does not use syscall send() but write() and that doesn't have the options. To simplify things I will use this solution on all supported platforms.
For more details have a look at: C++ & OpenSSL: SIGPIPE when writing in closed pipe.
Taking the idea and example from SIGPIPE_handler and adapt it. Thanks to kroki.
Definition at line 44 of file connection_common.hpp.