aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libtransport/src/implementation/socket_producer.h2
-rw-r--r--utils/src/hiperf.cc7
2 files changed, 7 insertions, 2 deletions
diff --git a/libtransport/src/implementation/socket_producer.h b/libtransport/src/implementation/socket_producer.h
index cae0ad7c7..9ccc59d9e 100644
--- a/libtransport/src/implementation/socket_producer.h
+++ b/libtransport/src/implementation/socket_producer.h
@@ -454,7 +454,7 @@ class ProducerSocket : public Socket<BasePortal>,
uint32_t socket_option_value) {
switch (socket_option_key) {
case GeneralTransportOptions::DATA_PACKET_SIZE:
- if (socket_option_value < default_values::max_content_object_size &&
+ if (socket_option_value <= default_values::max_content_object_size &&
socket_option_value > 0) {
data_packet_size_ = socket_option_value;
}
diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc
index eabd12c86..008bd0c55 100644
--- a/utils/src/hiperf.cc
+++ b/utils/src/hiperf.cc
@@ -165,7 +165,7 @@ struct ServerConfiguration {
rtc_(false),
interactive_(false),
production_rate_(std::string("2048kbps")),
- payload_size_(1400)
+ payload_size_(1440)
#ifdef SECURE_HICNTRANSPORT
,
secure_(false)
@@ -896,6 +896,11 @@ class HIperfServer {
}
}
+ producer_socket_->setSocketOption(
+ GeneralTransportOptions::DATA_PACKET_SIZE,
+ (uint32_t)(
+ configuration_.payload_size_ +
+ (configuration_.name.getAddressFamily() == AF_INET ? 40 : 60)));
producer_socket_->registerPrefix(configuration_.name);
producer_socket_->connect();