0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

use SO_LINGER

This commit is contained in:
Eliot Horowitz 2010-08-18 14:20:21 -04:00
parent 697bd7ff42
commit 7719fd049d

View File

@ -379,6 +379,13 @@ namespace mongo {
setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(int));
#endif
#ifdef SO_LINGER
struct linger ling;
ling.l_onoff = 1;
ling.l_linger = 0;
setsockopt(sock, SOL_SOCKET, SO_LINGER, (char *) &ling, sizeof(ling));
#endif
return true;
}