diff options
Diffstat (limited to 'src/mongo/db/service_context.cpp')
-rw-r--r-- | src/mongo/db/service_context.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mongo/db/service_context.cpp b/src/mongo/db/service_context.cpp index 03dc9bcaf8d..648fd546721 100644 --- a/src/mongo/db/service_context.cpp +++ b/src/mongo/db/service_context.cpp @@ -34,6 +34,9 @@ #include "mongo/db/client.h" #include "mongo/db/operation_context.h" #include "mongo/stdx/memory.h" +#include "mongo/transport/session.h" +#include "mongo/transport/transport_layer.h" +#include "mongo/transport/transport_layer_manager.h" #include "mongo/util/assert_util.h" #include "mongo/util/mongoutils/str.h" #include "mongo/util/system_clock_source.h" @@ -115,7 +118,8 @@ Status validateStorageOptions( } ServiceContext::ServiceContext() - : _tickSource(stdx::make_unique<SystemTickSource>()), + : _transportLayerManager(stdx::make_unique<transport::TransportLayerManager>()), + _tickSource(stdx::make_unique<SystemTickSource>()), _fastClockSource(stdx::make_unique<SystemClockSource>()), _preciseClockSource(stdx::make_unique<SystemClockSource>()) {} @@ -125,8 +129,8 @@ ServiceContext::~ServiceContext() { } ServiceContext::UniqueClient ServiceContext::makeClient(std::string desc, - AbstractMessagingPort* p) { - std::unique_ptr<Client> client(new Client(std::move(desc), this, p)); + transport::Session* session) { + std::unique_ptr<Client> client(new Client(std::move(desc), this, session)); auto observer = _clientObservers.cbegin(); try { for (; observer != _clientObservers.cend(); ++observer) { @@ -150,6 +154,14 @@ ServiceContext::UniqueClient ServiceContext::makeClient(std::string desc, return UniqueClient(client.release()); } +transport::TransportLayer* ServiceContext::getTransportLayer() const { + return _transportLayerManager.get(); +} + +Status ServiceContext::addAndStartTransportLayer(std::unique_ptr<transport::TransportLayer> tl) { + return _transportLayerManager->addAndStartTransportLayer(std::move(tl)); +} + TickSource* ServiceContext::getTickSource() const { return _tickSource.get(); } |