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:
parent
697bd7ff42
commit
7719fd049d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user