From e390b79a12a150b13570f7f0b19f50e1b0ead3a0 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 20 Feb 2014 00:00:05 +0100 Subject: Do not receive SIGPIPE when send() is called on a closed socket The error is handled using the return value --- src/network/socket_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/socket_handler.cpp b/src/network/socket_handler.cpp index 580bba6..7faa9fd 100644 --- a/src/network/socket_handler.cpp +++ b/src/network/socket_handler.cpp @@ -96,7 +96,7 @@ void SocketHandler::on_recv(const size_t nb) void SocketHandler::on_send() { - const ssize_t res = ::send(this->socket, this->out_buf.data(), this->out_buf.size(), 0); + const ssize_t res = ::send(this->socket, this->out_buf.data(), this->out_buf.size(), MSG_NOSIGNAL); if (res == -1) { log_error("send failed: " << strerror(errno)); -- cgit v1.2.3