Skip to content

Commit f6f0f4c

Browse files
committed
Update
1 parent 118740f commit f6f0f4c

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/proxyfmu/client/proxy_slave.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ proxy_slave::proxy_slave(const filesystem::path& fmuPath, const std::string& ins
6363
} else {
6464
host = remote->host();
6565
std::shared_ptr<TTransport> socket(new TSocket(host, remote->port()));
66-
auto transport = std::make_shared<TFramedTransport>(socket, MAX_FRAME_SIZE);
66+
auto t_config = std::make_shared<TConfiguration>();
67+
t_config->setMaxFrameSize(MAX_FRAME_SIZE);
68+
auto transport = std::make_shared<TFramedTransport>(socket, t_config);
6769
std::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
6870
auto client = std::make_shared<BootServiceClient>(protocol);
6971

@@ -95,7 +97,9 @@ proxy_slave::proxy_slave(const filesystem::path& fmuPath, const std::string& ins
9597
}
9698

9799
std::shared_ptr<TTransport> socket(new TSocket(host, port));
98-
transport_ = std::make_shared<TFramedTransport>(socket, MAX_FRAME_SIZE);
100+
auto t_config = std::make_shared<TConfiguration>();
101+
t_config->setMaxFrameSize(MAX_FRAME_SIZE);
102+
transport_ = std::make_shared<TFramedTransport>(socket, t_config);
99103
std::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport_));
100104
client_ = std::make_shared<FmuServiceClient>(protocol);
101105
transport_->open();

tool/proxyfmu.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class ServerReadyEventHandler : public TServerEventHandler
4242
}
4343
};
4444

45-
4645
class ProxyFMUFramedTransportFactory : public TTransportFactory
4746
{
4847
public:
@@ -52,7 +51,9 @@ class ProxyFMUFramedTransportFactory : public TTransportFactory
5251

5352
std::shared_ptr<TTransport> getTransport(std::shared_ptr<TTransport> trans) override
5453
{
55-
return std::shared_ptr<TTransport>(new TFramedTransport(trans, maxFrameSize_));
54+
auto t_config = std::make_shared<TConfiguration>();
55+
t_config->setMaxFrameSize(maxFrameSize_);
56+
return std::shared_ptr<TTransport>(new TFramedTransport(trans, t_config));
5657
}
5758

5859
private:
@@ -61,13 +62,14 @@ class ProxyFMUFramedTransportFactory : public TTransportFactory
6162

6263
const int port_range_min = 49152;
6364
const int port_range_max = 65535;
65+
const int MAX_FRAME_SIZE = 50 * 1024 * 1024;
66+
6467

6568
const int max_port_retries = 10;
6669

6770
const int SUCCESS = 0;
6871
const int COMMANDLINE_ERROR = 1;
6972
const int UNHANDLED_ERROR = 2;
70-
const int MAX_FRAME_SIZE = 50 * 1024 * 1024;
7173

7274

7375
void wait_for_input()

0 commit comments

Comments
 (0)