@@ -42,6 +42,23 @@ class ServerReadyEventHandler : public TServerEventHandler
4242 }
4343};
4444
45+
46+ class ProxyFMUFramedTransportFactory : public TTransportFactory
47+ {
48+ public:
49+ explicit ProxyFMUFramedTransportFactory (uint32_t maxFrameSize)
50+ : maxFrameSize_(maxFrameSize)
51+ { }
52+
53+ std::shared_ptr<TTransport> getTransport (std::shared_ptr<TTransport> trans) override
54+ {
55+ return std::shared_ptr<TTransport>(new TFramedTransport (trans, maxFrameSize_));
56+ }
57+
58+ private:
59+ uint32_t maxFrameSize_;
60+ };
61+
4562const int port_range_min = 49152 ;
4663const int port_range_max = 65535 ;
4764
@@ -50,6 +67,7 @@ const int max_port_retries = 10;
5067const int SUCCESS = 0 ;
5168const int COMMANDLINE_ERROR = 1 ;
5269const int UNHANDLED_ERROR = 2 ;
70+ const int MAX_FRAME_SIZE = 50 * 1024 * 1024 ;
5371
5472
5573void wait_for_input ()
@@ -68,7 +86,7 @@ int run_booter_application(const int port)
6886 std::shared_ptr<boot_service_handler> handler (new boot_service_handler ());
6987 std::shared_ptr<TProcessor> processor (new BootServiceProcessor (handler));
7088
71- std::shared_ptr<TTransportFactory> transportFactory (new TFramedTransportFactory ( ));
89+ std::shared_ptr<TTransportFactory> transportFactory (new ProxyFMUFramedTransportFactory (MAX_FRAME_SIZE ));
7290 std::shared_ptr<TProtocolFactory> protocolFactory (new TBinaryProtocolFactory ());
7391
7492 std::shared_ptr<TServerTransport> serverTransport (new TServerSocket (port));
@@ -93,7 +111,7 @@ int run_application(const std::string& fmu, const std::string& instanceName)
93111 std::shared_ptr<fmu_service_handler> handler (new fmu_service_handler (fmu, instanceName, stop));
94112 std::shared_ptr<TProcessor> processor (new FmuServiceProcessor (handler));
95113
96- std::shared_ptr<TTransportFactory> transportFactory (new TFramedTransportFactory ( ));
114+ std::shared_ptr<TTransportFactory> transportFactory (new ProxyFMUFramedTransportFactory (MAX_FRAME_SIZE ));
97115 std::shared_ptr<TProtocolFactory> protocolFactory (new TBinaryProtocolFactory ());
98116
99117 proxyfmu::fixed_range_random_generator rng (port_range_min, port_range_max);
0 commit comments