summaryrefslogtreecommitdiff
path: root/src/mongo/transport/session.h
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2018-02-14 14:47:52 -0500
committerJonathan Reams <jbreams@mongodb.com>2018-03-02 11:04:56 -0500
commit975d539ae068bd27ebb478b6f3673b89d2ad6beb (patch)
treebe4081de61244b451b2fb44ae37f58b2098e321a /src/mongo/transport/session.h
parent1ef8e418f15120c90699cfc5c6046f50bba7926a (diff)
downloadmongo-975d539ae068bd27ebb478b6f3673b89d2ad6beb.tar.gz
SERVER-33299 Add support for timeouts to TransportLayerASIO Sessions
Diffstat (limited to 'src/mongo/transport/session.h')
-rw-r--r--src/mongo/transport/session.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/transport/session.h b/src/mongo/transport/session.h
index d25d32b9027..db80aa0814d 100644
--- a/src/mongo/transport/session.h
+++ b/src/mongo/transport/session.h
@@ -112,6 +112,16 @@ public:
virtual Status sinkMessage(Message message) = 0;
virtual void asyncSinkMessage(Message message, std::function<void(Status)> cb) = 0;
+ /**
+ * This should only be used to detect when the remote host has disappeared without
+ * notice. It does NOT work correctly for ensuring that operations complete or fail
+ * by some deadline.
+ *
+ * This timeout will only effect calls sourceMessage()/sinkMessage(). Async operations do not
+ * currently support timeouts.
+ */
+ virtual void setTimeout(boost::optional<Milliseconds> timeout) = 0;
+
virtual const HostAndPort& remote() const = 0;
virtual const HostAndPort& local() const = 0;