aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/protocols/protocol.cc
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-06-09 00:03:15 +0200
committerMauro Sardara <msardara@cisco.com>2020-06-09 01:15:22 +0200
commita84ff82bb37ac53f20639d6e5e7f19d002459f31 (patch)
treee2ff9697793c320aaf17da2dd24b3611d64aa112 /libtransport/src/protocols/protocol.cc
parent37819ae5a3631afc8329d05d73ead9091fc513b3 (diff)
[HICN-623] Initialize is_async in ConsumerSocket constructor.
Also force transports to use base method TransportProtocol::start() instead of redefining their own start(), in order to have the callbacks and the boolean is_async_ initialized upon protocol start. Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: I780b26cca5b8dc59f0def5c08a032bbc90371acd Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport/src/protocols/protocol.cc')
-rw-r--r--libtransport/src/protocols/protocol.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/libtransport/src/protocols/protocol.cc b/libtransport/src/protocols/protocol.cc
index d1bd566a0..451fef80d 100644
--- a/libtransport/src/protocols/protocol.cc
+++ b/libtransport/src/protocols/protocol.cc
@@ -48,12 +48,6 @@ int TransportProtocol::start() {
// If the protocol is already running, return otherwise set as running
if (is_running_) return -1;
- // Reset the protocol state machine
- reset();
-
- // Set it is the first time we schedule an interest
- is_first_ = true;
-
// Get all callbacks references before starting
socket_->getSocketOption(ConsumerCallbacksOptions::INTEREST_RETRANSMISSION,
&on_interest_retransmission_);
@@ -75,6 +69,11 @@ int TransportProtocol::start() {
&on_payload_);
socket_->getSocketOption(GeneralTransportOptions::ASYNC_MODE, is_async_);
+ // Set it is the first time we schedule an interest
+ is_first_ = true;
+
+ // Reset the protocol state machine
+ reset();
// Schedule next interests
scheduleNextInterests();