From 26b73b604dcf50be9402276a45f73329beb7f7ae Mon Sep 17 00:00:00 2001 From: Alexander Yalov Date: Tue, 26 Mar 2024 00:15:43 +0200 Subject: [PATCH] linux flag: MSG_NOSIGNAL --- Source/ScsSendQueue.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/ScsSendQueue.cpp b/Source/ScsSendQueue.cpp index 686ef56..35e47f8 100644 --- a/Source/ScsSendQueue.cpp +++ b/Source/ScsSendQueue.cpp @@ -24,6 +24,10 @@ THE SOFTWARE. #include "ScsInternal.h" +#ifdef SCS_WINDOWS +# define MSG_NOSIGNAL 0 +#endif + using namespace Scs; @@ -39,7 +43,7 @@ bool SendQueue::Send(SocketPtr socket) assert(!m_queue.empty()); auto buffer = m_queue.front(); size_t bytesSent = 0; - if (!socket->Send(buffer->data() + m_bytesSent, buffer->size() - m_bytesSent, 0, &bytesSent)) + if (!socket->Send(buffer->data() + m_bytesSent, buffer->size() - m_bytesSent, MSG_NOSIGNAL, &bytesSent)) return false; m_bytesSent += bytesSent; if (m_bytesSent == buffer->size())