summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authormichele papalini <micpapal@cisco.com>2019-04-03 16:02:19 +0200
committermichele papalini <micpapal@cisco.com>2019-04-03 16:02:19 +0200
commit0ddf1dd65f265bf8b3d0830134fa12675263dc5f (patch)
treea00e5fde0637561c3806952400a116a2a2d19c0a /utils
parent693710043ebba18bb6457832127512a64c7b0aa6 (diff)
[HICN-164] hiperf RTC rate
Change-Id: I17eae19aaf717255c8812738868c27e4e5a9bb95 Signed-off-by: michele papalini <micpapal@cisco.com>
Diffstat (limited to 'utils')
-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());
}
}