diff --git a/src/tcpconnected.h b/src/tcpconnected.h index 8cb827f..7b77aae 100644 --- a/src/tcpconnected.h +++ b/src/tcpconnected.h @@ -187,10 +187,10 @@ public: { // is there already a buffer of data that can not be sent? 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; diff --git a/src/tcpoutbuffer.h b/src/tcpoutbuffer.h index 6ebd5fa..6a84de4 100644 --- a/src/tcpoutbuffer.h +++ b/src/tcpoutbuffer.h @@ -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