NORM_SYNC_ALL policy improvement

pull/68/head
bebopagogo 2022-05-09 11:30:24 -04:00
parent c29ef4adbd
commit 46a030891d
4 changed files with 35 additions and 5 deletions

30
src/common/grttProbe.cpp Normal file
View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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