diff --git a/src/common/grttProbe.cpp b/src/common/grttProbe.cpp new file mode 100644 index 0000000..3f6554c --- /dev/null +++ b/src/common/grttProbe.cpp @@ -0,0 +1,30 @@ +#include "grttProbe.h" + +// This code is _not_ part of the NORM protocol library. This +// is an independent class that can be used as an alternative +// to conduct the sort of GRTT probing that is conducted as part +// of NORM protocol operation. This can be used in conjunction +// with NORM by disabling NORM's built-in GRTT probing and using +// the information collected from this independent probing to +// dynamically and explicitly set the NORM sender GRTT estimate. + + +using namespace GrttProbe +{ + // return length in 32-bit words (i.e. 1 word == 4 bytes) + unsigned int GetIdWords(IdType idType) + { + switch (idType) + { + case ID_INT32: + case ID_IPV4: + return 1; + case ID_IPV6: + return 4; + case ID_ETH: + return 2; // includes padding + default: + return 0; + } + } // end GrttProbe::Message::GetIdWords() +}; // end namespace GrttProbe diff --git a/src/common/normNode.cpp b/src/common/normNode.cpp index 719cbb6..e830543 100644 --- a/src/common/normNode.cpp +++ b/src/common/normNode.cpp @@ -813,7 +813,7 @@ void NormSenderNode::HandleCommand(const struct timeval& currentTime, } if (!synchronized) { - if (doAck) + if ((doAck) || (SYNC_ALL == sync_policy)) { // Force sync since we're expected to ACK // and request repair for object indicated @@ -2012,7 +2012,7 @@ void NormSenderNode::Sync(NormObjectId objectId) max_pending_object = objectId; break; } - SetPending(objectId); // inclusively sets pending mask for next_id..objectId + SetPending(objectId); // inclusively sets pending mask for next_id..objectId } } // end NormSenderNode::Sync() diff --git a/src/common/normSession.cpp b/src/common/normSession.cpp index 7524786..0185187 100644 --- a/src/common/normSession.cpp +++ b/src/common/normSession.cpp @@ -2397,10 +2397,10 @@ void NormSession::RxSocketRecvHandler(ProtoSocket &theSocket, HandleReceiveMessage(msg, wasUnicast, ecnStatus); msgLength = NormMsg::MAX_SIZE; } - else + else { PLOG(PL_ERROR, "NormSession::RxSocketRecvHandler() warning: received bad message\n"); - } + } // end if/else msg.InitFromBuffer() // If our system gets very busy reading sockets, we should occasionally // execute any timeouts to keep protocol operation smooth (i.e., sending feedback) // TBD - perhaps this should be time based diff --git a/src/pynorm/core.py b/src/pynorm/core.py index 9c39b95..0cdee7e 100644 --- a/src/pynorm/core.py +++ b/src/pynorm/core.py @@ -503,7 +503,7 @@ def get_libnorm(): # Experimental functions libnorm.NormCountCompletedObjects.restype = ctypes.c_uint32 libnorm.NormCountCompletedObjects.argtypes = [ctypes.c_void_p] - + return libnorm # Global libnorm reference that everyone should use