diff options
author | Matt Cotter <matt.cotter@mongodb.com> | 2016-01-27 16:39:14 -0500 |
---|---|---|
committer | Matt Cotter <matt.cotter@mongodb.com> | 2016-05-20 14:06:28 -0400 |
commit | 225a2a57350c79a190c13054a038b6c3c559a558 (patch) | |
tree | 6e24efd0f62c580e1c09e17d5b5d7a561dd63e01 /src/mongo/util/net/sock.h | |
parent | e6e7e099aaf11afb626d2cd95dd1d339433f6e7f (diff) | |
download | mongo-225a2a57350c79a190c13054a038b6c3c559a558.tar.gz |
SERVER-23448 create an ASIO based MessagingPort
Diffstat (limited to 'src/mongo/util/net/sock.h')
-rw-r--r-- | src/mongo/util/net/sock.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/util/net/sock.h b/src/mongo/util/net/sock.h index 1ef0381c1c8..d607eb8051c 100644 --- a/src/mongo/util/net/sock.h +++ b/src/mongo/util/net/sock.h @@ -178,6 +178,17 @@ public: return _fd; } + /** + * This sets the Sock's socket descriptor to be invalid and returns the old descriptor. This + * only gets called in listen.cpp in Listener::_accepted(). This gets called on the listener + * thread immediately after the thread creates the Sock, so it doesn't need to be thread-safe. + */ + int stealSD() { + int tmp = _fd; + _fd = -1; + return tmp; + } + void setTimeout(double secs); bool isStillConnected(); |