diff options
author | Samantha Ritter <samantha.ritter@10gen.com> | 2016-05-31 14:05:17 -0400 |
---|---|---|
committer | Jason Carey <jcarey@argv.me> | 2016-07-12 18:38:37 -0400 |
commit | c263ce1f95586f8652058e6202015a77f9becc49 (patch) | |
tree | d623fb9da9fd5da3cc4e20cac0653f1fa4af00eb /src/mongo/db/client.cpp | |
parent | dead3cf8b4b3cb5528ad1abb9eeb722b395e3632 (diff) | |
download | mongo-c263ce1f95586f8652058e6202015a77f9becc49.tar.gz |
SERVER-24162 Integrate TransportLayer
Expand the transport layer as needed to replace uses of abstract message port for ingress
networking.
Diffstat (limited to 'src/mongo/db/client.cpp')
-rw-r--r-- | src/mongo/db/client.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp index 807a7650aa5..2a665268811 100644 --- a/src/mongo/db/client.cpp +++ b/src/mongo/db/client.cpp @@ -44,6 +44,7 @@ #include "mongo/db/lasterror.h" #include "mongo/db/service_context.h" #include "mongo/stdx/thread.h" +#include "mongo/transport/session.h" #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/exit.h" #include "mongo/util/mongoutils/str.h" @@ -63,16 +64,16 @@ void Client::initThreadIfNotAlready() { initThreadIfNotAlready(getThreadName().c_str()); } -void Client::initThread(const char* desc, AbstractMessagingPort* mp) { - initThread(desc, getGlobalServiceContext(), mp); +void Client::initThread(const char* desc, transport::Session* session) { + initThread(desc, getGlobalServiceContext(), session); } -void Client::initThread(const char* desc, ServiceContext* service, AbstractMessagingPort* mp) { +void Client::initThread(const char* desc, ServiceContext* service, transport::Session* session) { invariant(currentClient.getMake()->get() == nullptr); std::string fullDesc; - if (mp != NULL) { - fullDesc = str::stream() << desc << mp->connectionId(); + if (session) { + fullDesc = str::stream() << desc << session->id(); } else { fullDesc = desc; } @@ -80,7 +81,7 @@ void Client::initThread(const char* desc, ServiceContext* service, AbstractMessa setThreadName(fullDesc.c_str()); // Create the client obj, attach to thread - *currentClient.get() = service->makeClient(fullDesc, mp); + *currentClient.get() = service->makeClient(fullDesc, session); } void Client::destroy() { @@ -98,11 +99,11 @@ int64_t generateSeed(const std::string& desc) { } } // namespace -Client::Client(std::string desc, ServiceContext* serviceContext, AbstractMessagingPort* p) - : ClientBasic(serviceContext, p), +Client::Client(std::string desc, ServiceContext* serviceContext, transport::Session* session) + : ClientBasic(serviceContext, session), _desc(std::move(desc)), _threadId(stdx::this_thread::get_id()), - _connectionId(p ? p->connectionId() : 0), + _connectionId(session ? session->id() : 0), _prng(generateSeed(_desc)) {} void Client::reportState(BSONObjBuilder& builder) { |