summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-04-03 14:32:46 +0000
committerGerrit Code Review <gerrit@fd.io>2019-04-03 14:32:46 +0000
commit555d1f90b21b3beb5f9aa514a0e83dabdc0cd793 (patch)
tree18176abc3e021df89a44e3d3baeb325847a8f3a2
parentfc938965a323d0865faf1fc93e375cdfbb66aa7b (diff)
parent0ddf1dd65f265bf8b3d0830134fa12675263dc5f (diff)
Merge "[HICN-164] hiperf RTC rate"
-rw-r--r--utils/src/hiperf.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc
index 425b91bca..d546cfca9 100644
--- a/utils/src/hiperf.cc
+++ b/utils/src/hiperf.cc
@@ -100,7 +100,7 @@ class Rate {
std::chrono::microseconds getMicrosecondsForPacket(std::size_t packet_size) {
return std::chrono::microseconds(
- packet_size * long(std::round(1000.0 * 8.0 / rate_kbps_)));
+ (uint32_t)std::round(packet_size * 1000.0 * 8.0 / (double)rate_kbps_));
}
private:
@@ -551,15 +551,15 @@ class HIperfServer {
void sendRTCContentObjectCallback(std::error_code ec) {
if (!ec) {
- auto payload =
- content_objects_[content_objects_index_++ & mask_]->getPayload();
- producer_socket_->produce(payload->data(), payload->length());
rtc_timer_.expires_from_now(
configuration_.production_rate_.getMicrosecondsForPacket(
configuration_.payload_size_));
rtc_timer_.async_wait(
std::bind(&HIperfServer::sendRTCContentObjectCallback, this,
std::placeholders::_1));
+ auto payload =
+ content_objects_[content_objects_index_++ & mask_]->getPayload();
+ producer_socket_->produce(payload->data(), payload->length());
}
}