io
io copied to clipboard
Setting SO_NOSIGPIPE on Socket for BSD derivatives
Under macOS, for example, If the socket for whatever reason is closed, you end up in the SIGPIPE handler.
Setting the SO_NOSIGPIPE option will instruct the OS to not generate SIGPIPE, but instead return EPIPE, which can be handled gracefully along with other IO errors.
I'll look into allowing this as an option.