Fixed #134: use MSG_NOSIGNAL to avoid SIGPIPE.

This commit is contained in:
Vincent Richard 2016-03-03 20:24:27 +01:00
parent 7d2ef7311e
commit b8b5586d6a

View File

@ -723,7 +723,7 @@ void posixSocket::sendRaw(const byte_t* buffer, const size_t count)
while (size > 0)
{
const ssize_t ret = ::send(m_desc, buffer, size, 0);
const ssize_t ret = ::send(m_desc, buffer, size, MSG_NOSIGNAL);
if (ret <= 0)
{
@ -749,7 +749,7 @@ size_t posixSocket::sendRawNonBlocking(const byte_t* buffer, const size_t count)
{
m_status &= ~STATUS_WOULDBLOCK;
const ssize_t ret = ::send(m_desc, buffer, count, 0);
const ssize_t ret = ::send(m_desc, buffer, count, MSG_NOSIGNAL);
if (ret <= 0)
{