Do not receive SIGPIPE when send() is called on a closed socket
The error is handled using the return value
This commit is contained in:
1 parent
16be9af3fc
commit
e390b79a12
1 file changed
+1
-1
@@ -96,7 +96,7 @@ void SocketHandler::on_recv(const size_t nb)
|
|||||||
|
|
||||||
void SocketHandler::on_send()
|
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)
|
if (res == -1)
|
||||||
{
|
{
|
||||||
log_error("send failed: " << strerror(errno));
|
log_error("send failed: " << strerror(errno));
|
||||||
|
|||||||
Reference in new issue
Block a user