@@ -42,8 +42,28 @@ class ServerReadyEventHandler : public TServerEventHandler
4242 }
4343};
4444
45+ class ProxyFMUFramedTransportFactory : public TTransportFactory
46+ {
47+ public:
48+ explicit ProxyFMUFramedTransportFactory (uint32_t maxFrameSize)
49+ : maxFrameSize_(maxFrameSize)
50+ { }
51+
52+ std::shared_ptr<TTransport> getTransport (std::shared_ptr<TTransport> trans) override
53+ {
54+ auto t_config = std::make_shared<TConfiguration>();
55+ t_config->setMaxFrameSize (maxFrameSize_);
56+ return std::shared_ptr<TTransport>(new TFramedTransport (trans, t_config));
57+ }
58+
59+ private:
60+ uint32_t maxFrameSize_;
61+ };
62+
4563const int port_range_min = 49152 ;
4664const int port_range_max = 65535 ;
65+ const int MAX_FRAME_SIZE = 50 * 1024 * 1024 ;
66+
4767
4868const int max_port_retries = 10 ;
4969
@@ -68,7 +88,7 @@ int run_booter_application(const int port)
6888 std::shared_ptr<boot_service_handler> handler (new boot_service_handler ());
6989 std::shared_ptr<TProcessor> processor (new BootServiceProcessor (handler));
7090
71- std::shared_ptr<TTransportFactory> transportFactory (new TFramedTransportFactory ( ));
91+ std::shared_ptr<TTransportFactory> transportFactory (new ProxyFMUFramedTransportFactory (MAX_FRAME_SIZE ));
7292 std::shared_ptr<TProtocolFactory> protocolFactory (new TBinaryProtocolFactory ());
7393
7494 std::shared_ptr<TServerTransport> serverTransport (new TServerSocket (port));
@@ -93,7 +113,7 @@ int run_application(const std::string& fmu, const std::string& instanceName)
93113 std::shared_ptr<fmu_service_handler> handler (new fmu_service_handler (fmu, instanceName, stop));
94114 std::shared_ptr<TProcessor> processor (new FmuServiceProcessor (handler));
95115
96- std::shared_ptr<TTransportFactory> transportFactory (new TFramedTransportFactory ( ));
116+ std::shared_ptr<TTransportFactory> transportFactory (new ProxyFMUFramedTransportFactory (MAX_FRAME_SIZE ));
97117 std::shared_ptr<TProtocolFactory> protocolFactory (new TBinaryProtocolFactory ());
98118
99119 proxyfmu::fixed_range_random_generator rng (port_range_min, port_range_max);
0 commit comments