mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +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));
|
setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(int));
|
||||||
#endif
|
#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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user