work in progress to prevent SIGPIPE signals (this is going to fix #79)

This commit is contained in:
Emiel Bruijntjes 2016-07-06 13:03:51 +02:00
parent dddd16b74d
commit aad09a1dd2
2 changed files with 4 additions and 3 deletions

View File

@ -189,7 +189,7 @@ public:
if (_out) return _out.add(buffer, size);
// there is no buffer, send the data right away
auto result = write(_socket, buffer, size);
auto result = ::send(_socket, buffer, size, MSG_NOSIGNAL);
// number of bytes sent
size_t bytes = result < 0 ? 0 : result;

View File

@ -226,6 +226,7 @@ public:
}
// send the data
// @todo use sendmsg() with a MSG_NOSIG flag
auto result = writev(socket, (const struct iovec *)&buffer, index);
// skip on error, or when nothing was written