summaryrefslogtreecommitdiffstats
path: root/messagebus
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-11-30 11:39:32 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-12-01 13:45:48 +0000
commita7a0764e7e785f12ed40cd45d420e1b81991d402 (patch)
tree34d1caf0842f7be3620b8d49e1f48f21adc67db7 /messagebus
parentef1c43d5433e4cf5ae7dd581f1c72c46e5611118 (diff)
provide the config in the constructor only.
Diffstat (limited to 'messagebus')
-rw-r--r--messagebus/src/vespa/messagebus/network/rpcnetwork.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
index 893b8d1d2ca..c286b056ae2 100644
--- a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
+++ b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
@@ -79,6 +79,13 @@ struct TargetPoolTask : public FNET_Task {
}
};
+TransportConfig
+toFNETConfig(const RPCNetworkParams & params) {
+ return TransportConfig().config(FNET_Config().maxInputBufferSize(params.getMaxInputBufferSize())
+ .maxOutputBufferSize(params.getMaxOutputBufferSize())
+ .tcpNoDelay(params.getTcpNoDelay()));
+}
+
}
RPCNetwork::SendContext::SendContext(RPCNetwork &net, const Message &msg,
@@ -117,7 +124,7 @@ RPCNetwork::RPCNetwork(const RPCNetworkParams &params) :
_owner(nullptr),
_ident(params.getIdentity()),
_threadPool(std::make_unique<FastOS_ThreadPool>(128000, 0)),
- _transport(std::make_unique<FNET_Transport>()),
+ _transport(std::make_unique<FNET_Transport>(toFNETConfig(params))),
_orb(std::make_unique<FRT_Supervisor>(_transport.get())),
_scheduler(*_transport->GetScheduler()),
_slobrokCfgFactory(std::make_unique<slobrok::ConfiguratorFactory>(params.getSlobrokConfig())),
@@ -135,9 +142,6 @@ RPCNetwork::RPCNetwork(const RPCNetworkParams &params) :
_allowDispatchForEncode(params.getDispatchOnEncode()),
_allowDispatchForDecode(params.getDispatchOnDecode())
{
- _transport->SetMaxInputBufferSize(params.getMaxInputBufferSize());
- _transport->SetMaxOutputBufferSize(params.getMaxOutputBufferSize());
- _transport->SetTCPNoDelay(params.getTcpNoDelay());
}
RPCNetwork::~RPCNetwork()