summaryrefslogtreecommitdiff
path: root/src/mongo/util/net/sock.h
diff options
context:
space:
mode:
authorMatt Cotter <matt.cotter@mongodb.com>2016-01-27 16:39:14 -0500
committerMatt Cotter <matt.cotter@mongodb.com>2016-05-20 14:06:28 -0400
commit225a2a57350c79a190c13054a038b6c3c559a558 (patch)
tree6e24efd0f62c580e1c09e17d5b5d7a561dd63e01 /src/mongo/util/net/sock.h
parente6e7e099aaf11afb626d2cd95dd1d339433f6e7f (diff)
downloadmongo-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.h11
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();