diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-12 11:50:35 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-05-12 11:50:35 +0000 |
commit | 0ed9a326c02931da82be5eca271540a2acda0544 (patch) | |
tree | 418b9fe2f9c72838c5bc1ddcb570ce849e61f431 /searchcore/src/apps/proton/proton.cpp | |
parent | e2a3bb9086da8da6ea1ef0c84066748a9e5ac1cf (diff) |
Start the transport in teh constructor.
Diffstat (limited to 'searchcore/src/apps/proton/proton.cpp')
-rw-r--r-- | searchcore/src/apps/proton/proton.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp index 4dc8a90079a..386ceb4eeda 100644 --- a/searchcore/src/apps/proton/proton.cpp +++ b/searchcore/src/apps/proton/proton.cpp @@ -205,9 +205,11 @@ buildTransportConfig() { class Transport { public: - Transport(const fnet::TransportConfig & config) + Transport(const fnet::TransportConfig & config, FastOS_ThreadPool & threadPool) : _transport(config) - {} + { + _transport.Start(&threadPool); + } ~Transport() { _transport.ShutDown(true); } @@ -281,8 +283,7 @@ App::main(int argc, char **argv) setupSignals(); setup_fadvise(); FastOS_ThreadPool threadPool(128_Ki); - Transport transport(buildTransportConfig()); - transport.transport().Start(&threadPool); + Transport transport(buildTransportConfig(), threadPool); startAndRun(threadPool, transport.transport(), argc, argv); } catch (const vespalib::InvalidCommandLineArgumentsException &e) { LOG(warning, "Invalid commandline arguments: '%s'", e.what()); |