aboutsummaryrefslogtreecommitdiffstats
path: root/apps/http-proxy/src/IcnReceiver.cc
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-05-15 14:31:17 +0200
committerMauro Sardara <msardara@cisco.com>2019-05-15 15:26:20 +0200
commit31f349f4c4457344efcff20ccadfed53042891b1 (patch)
tree3158a7216fc3ede9beb603ef6267255238014de9 /apps/http-proxy/src/IcnReceiver.cc
parent8a4273ffe83b46bc018da58135427d40012282b8 (diff)
[HICN-196] Add mtu to command line parameters.
Change-Id: Ib6932c23408630be1ca98146d22ac494ad5e5077 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'apps/http-proxy/src/IcnReceiver.cc')
-rw-r--r--apps/http-proxy/src/IcnReceiver.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/http-proxy/src/IcnReceiver.cc b/apps/http-proxy/src/IcnReceiver.cc
index 4ad616168..fc6837a2c 100644
--- a/apps/http-proxy/src/IcnReceiver.cc
+++ b/apps/http-proxy/src/IcnReceiver.cc
@@ -55,12 +55,14 @@ core::Prefix generatePrefix(const std::string& prefix_url) {
AsyncConsumerProducer::AsyncConsumerProducer(const std::string& prefix,
std::string& ip_address,
std::string& port,
- std::string& cache_size)
+ std::string& cache_size,
+ std::string& mtu)
: prefix_(generatePrefix(prefix)),
producer_socket_(),
ip_address_(ip_address),
port_(port),
cache_size_(std::stoul(cache_size)),
+ mtu_(std::stoul(mtu)),
request_counter_(0),
signals_(io_service_, SIGINT, SIGQUIT),
connector_(io_service_, ip_address_, port_,
@@ -78,6 +80,13 @@ AsyncConsumerProducer::AsyncConsumerProducer(const std::string& prefix,
TRANSPORT_LOGD("Warning: output buffer size has not been set.");
}
+ ret = producer_socket_.setSocketOption(
+ interface::GeneralTransportOptions::DATA_PACKET_SIZE, mtu_);
+
+ if (ret != SOCKET_OPTION_SET) {
+ TRANSPORT_LOGD("Warning: mtu has not been set.");
+ }
+
producer_socket_.registerPrefix(prefix_);
// Let the main thread to catch SIGINT and SIGQUIT