summaryrefslogtreecommitdiffstats
path: root/utils/src
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-03-04 16:21:54 +0100
committerMauro Sardara <msardara@cisco.com>2020-03-09 13:02:50 +0000
commitafe807c61372fe2481e73af63c8382af1e1d3011 (patch)
tree181269bc2548bba9eb667df4301ded197183a4cf /utils/src
parent248bfd5ad0ae3cc17bbd3ea3b9a47fa8d075ee58 (diff)
[HICN-540] Optimizations for libhicntransport
Change-Id: I8b46b4eb2ef5488c09041887cc8296a216440f33 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'utils/src')
-rw-r--r--utils/src/hiperf.cc29
1 files changed, 10 insertions, 19 deletions
diff --git a/utils/src/hiperf.cc b/utils/src/hiperf.cc
index e037e1309..2b78a02b9 100644
--- a/utils/src/hiperf.cc
+++ b/utils/src/hiperf.cc
@@ -69,7 +69,6 @@ struct ClientConfiguration {
beta(-1.f),
drop_factor(-1.f),
window(-1),
- virtual_download(true),
producer_certificate(""),
passphrase(""),
receive_buffer(nullptr),
@@ -90,7 +89,6 @@ struct ClientConfiguration {
double beta;
double drop_factor;
double window;
- bool virtual_download;
std::string producer_certificate;
std::string passphrase;
std::shared_ptr<utils::MemBuf> receive_buffer;
@@ -423,12 +421,6 @@ class HIperfClient {
}
}
- if (consumer_socket_->setSocketOption(OtherOptions::VIRTUAL_DOWNLOAD,
- configuration_.virtual_download) ==
- SOCKET_OPTION_NOT_SET) {
- return ERROR_SETUP;
- }
-
if (configuration_.verify) {
std::shared_ptr<utils::Verifier> verifier =
std::make_shared<utils::Verifier>();
@@ -570,15 +562,21 @@ class HIperfClient {
};
class Callback : public ConsumerSocket::ReadCallback {
- static constexpr std::size_t read_size = 16 * 1024;
+ static constexpr std::size_t read_size = 128 * 1024;
public:
- Callback(HIperfClient &hiperf_client) : client_(hiperf_client) {}
+ Callback(HIperfClient &hiperf_client) : client_(hiperf_client) {
+ client_.configuration_.receive_buffer = utils::MemBuf::create(read_size);
+ }
- bool isBufferMovable() noexcept override { return true; }
+ bool isBufferMovable() noexcept override { return false; }
void getReadBuffer(uint8_t **application_buffer,
- size_t *max_length) override {}
+ size_t *max_length) override {
+ *application_buffer =
+ client_.configuration_.receive_buffer->writableData();
+ *max_length = read_size;
+ }
void readDataAvailable(std::size_t length) noexcept override {}
@@ -1149,8 +1147,6 @@ void usage() {
<< std::endl;
std::cerr << "-L\t<interest lifetime>\t\t"
<< "Set interest lifetime." << std::endl;
- std::cerr << "-M\t<Download for real>\t\t"
- << "Store the content downloaded." << std::endl;
std::cerr << "-W\t<window_size>\t\t\t"
<< "Use a fixed congestion window "
"for retrieving the data."
@@ -1264,11 +1260,6 @@ int main(int argc, char *argv[]) {
options = 1;
break;
}
- case 'M': {
- client_configuration.virtual_download = false;
- options = 1;
- break;
- }
#ifdef SECURE_HICNTRANSPORT
case 'P': {
client_configuration.producer_prefix_ = Prefix(optarg);