From 0c16e193ceef70eaf8ff8e05ce124bb4bcf3eb46 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 4 Oct 2014 10:09:28 +1000 Subject: [PATCH] Set no linger on all connected clients --- src/connector.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/connector.c b/src/connector.c index 71941848..97f51418 100644 --- a/src/connector.c +++ b/src/connector.c @@ -131,6 +131,7 @@ retry: } keep_sockalive(fd); + nolinger_socket(fd); LOGINFO("Connected new client %d on socket %d from %s:%d", ci->nfds, fd, client->address_name, port); @@ -155,10 +156,6 @@ static int drop_client(conn_instance_t *ci, client_instance_t *client) ck_wlock(&ci->lock); fd = client->fd; if (fd != -1) { - const struct linger so_linger = { 1, 0 }; - - if (unlikely(setsockopt(client->fd, SOL_SOCKET, SO_LINGER, &so_linger, sizeof(so_linger)))) - LOGWARNING("setsockopt failed with errno %d:%s", errno, strerror(errno)); Close(client->fd); HASH_DEL(clients, client); HASH_DELETE(fdhh, fdclients, client);