make tabs/spaces consistent; fix minor SetSilentReceiver logic bug; add missing bits to usage statements; copy 'ack auto' commandline option and logic from normCast/normStreamer into normMsgr
parent
0ff199fc3c
commit
fe2e9d7f02
|
|
@ -143,7 +143,7 @@ class NormCaster
|
|||
norm_acking = enable;
|
||||
}
|
||||
void SetSilentReceiver(bool state)
|
||||
{NormSetSilentReceiver(norm_session, true);}
|
||||
{NormSetSilentReceiver(norm_session, state);}
|
||||
|
||||
void SetProbeTOS(UINT8 value)
|
||||
{probe_tos = value;}
|
||||
|
|
@ -667,10 +667,12 @@ void NormCaster::HandleNormEvent(const NormEvent& event)
|
|||
|
||||
void Usage()
|
||||
{
|
||||
fprintf(stderr, "Usage: normCast id <nodeId> {send <file/dir list> &| recv <rxCacheDir>}\n"
|
||||
" [addr <addr>[/<port>]][interface <name>][ack <node1>[,<node2>,...]\n"
|
||||
" [cc|cce|ccl|rate <bitsPerSecond>][ptos <value>]\n"
|
||||
" [debug <level>][trace]\n");
|
||||
fprintf(stderr, "Usage: normCast id <nodeIdInteger> {send <file/dir list> &| recv <rxCacheDir>}\n"
|
||||
" [addr <addr>[/<port>]] [interface <name>] [loopback]\n"
|
||||
" [ack auto|<node1>[,<node2>,...]]\n"
|
||||
" [cc|cce|ccl|rate <bitsPerSecond>] [ptos <value>]\n"
|
||||
" [flush {none|passive|active}] [silent] [txloss <lossFraction>]\n"
|
||||
" [debug <level>] [trace] [log <logfile>]\n");
|
||||
} // end Usage()
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
|
|
|
|||
|
|
@ -192,8 +192,14 @@ class NormMsgr
|
|||
{omit_header = state;}
|
||||
|
||||
// These can only be called post-OpenNormSession
|
||||
void SetAutoAck(bool enable)
|
||||
{
|
||||
NormTrackingStatus trackingMode = enable? NORM_TRACK_RECEIVERS : NORM_TRACK_NONE;
|
||||
NormSetAutoAckingNodes(norm_session, trackingMode);
|
||||
norm_acking = enable;
|
||||
}
|
||||
void SetSilentReceiver(bool state)
|
||||
{NormSetSilentReceiver(norm_session, true);}
|
||||
{NormSetSilentReceiver(norm_session, state);}
|
||||
void SetTxLoss(double txloss)
|
||||
{NormSetTxLoss(norm_session, txloss);}
|
||||
|
||||
|
|
@ -773,9 +779,11 @@ void NormMsgr::HandleNormEvent(const NormEvent& event)
|
|||
|
||||
void Usage()
|
||||
{
|
||||
fprintf(stderr, "Usage: normMsgr id <nodeId> {send &| recv} [addr <addr>[/<port>]][ack <node1>[,<node2>,...]\n"
|
||||
" [cc|cce|ccl|rate <bitsPerSecond>][interface <name>][debug <level>][trace]\n"
|
||||
" [flush {none|active}][omit][silent][txloss <lossFraction>]\n");
|
||||
fprintf(stderr, "Usage: normMsgr id <nodeIdInteger> {send &| recv} [addr <addr>[/<port>]]\n"
|
||||
" [ack auto|<node1>[,<node2>,...]] [output <outFile>]\n"
|
||||
" [cc|cce|ccl|rate <bitsPerSecond>] [interface <name>] [loopback]\n"
|
||||
" [debug <level>] [trace] [log <logfile>] [silent]\n"
|
||||
" [flush {none|passive|active}] [omit] [txloss <lossFraction>]\n");
|
||||
}
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
|
@ -788,6 +796,7 @@ int main(int argc, char* argv[])
|
|||
strcpy(sessionAddr, "224.1.2.3");
|
||||
unsigned int sessionPort = 6003;
|
||||
|
||||
bool autoAck = false;
|
||||
NormNodeId ackingNodeList[256];
|
||||
unsigned int ackingNodeCount = 0;
|
||||
bool flushing = false;
|
||||
|
|
@ -886,6 +895,13 @@ int main(int argc, char* argv[])
|
|||
return -1;
|
||||
}
|
||||
const char* alist = argv[i++];
|
||||
if (0 == strcmp("auto", alist))
|
||||
{
|
||||
autoAck = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
autoAck = false;
|
||||
while ((NULL != alist) && (*alist != '\0'))
|
||||
{
|
||||
// TBD - Do we need to skip leading white space?
|
||||
|
|
@ -902,6 +918,7 @@ int main(int argc, char* argv[])
|
|||
if (NULL != alist) alist++; // point past comma
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (0 == strncmp(cmd, "flush", len))
|
||||
{
|
||||
// "none", "passive", or "active"
|
||||
|
|
@ -1057,8 +1074,15 @@ int main(int argc, char* argv[])
|
|||
if (silentReceiver) normMsgr.SetSilentReceiver(true);
|
||||
if (txloss > 0.0) normMsgr.SetTxLoss(txloss);
|
||||
|
||||
if (autoAck)
|
||||
{
|
||||
normMsgr.SetAutoAck(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int i = 0; i < ackingNodeCount; i++)
|
||||
normMsgr.AddAckingNode(ackingNodeList[i]);
|
||||
}
|
||||
|
||||
normMsgr.SetNormCongestionControl(ccMode);
|
||||
if (NormMsgr::NORM_FIXED == ccMode)
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ class NormStreamer
|
|||
|
||||
// These can only be called post-OpenNormSession()
|
||||
void SetSilentReceiver(bool state)
|
||||
{NormSetSilentReceiver(norm_session, true);}
|
||||
{NormSetSilentReceiver(norm_session, state);}
|
||||
void SetTxLoss(double txloss)
|
||||
{NormSetTxLoss(norm_session, txloss);}
|
||||
// Set the scheduler for running the app and norm threads.
|
||||
|
|
@ -1340,17 +1340,21 @@ void NormStreamer::HandleNormEvent(const NormEvent& event)
|
|||
|
||||
void Usage()
|
||||
{
|
||||
fprintf(stderr, "Usage: normStreamer id <nodeId> {send|recv} [addr <addr>[/<port>]][interface <name>][loopback][info]\n"
|
||||
" [cc|cce|ccl|rate <bitsPerSecond>][ack <node1>[,<node2>,...][flush {none|passive|active}]\n"
|
||||
" [listen [<mcastAddr>/]<port>][linterface <name>]\n"
|
||||
" [relay <dstAddr>/<port>][limit [<rate>/]<depth>][output <device>]\n"
|
||||
" [boost][debug <level>][trace][log <logfile>]\n"
|
||||
" [segment <bytes>][block <count>][parity <count>][auto <count>]\n"
|
||||
" [insockbuffer <bytes>][outsockbuffer <bytes>]\n"
|
||||
" [txsockbuffer <bytes>][rxsockbuffer <bytes>]\n"
|
||||
fprintf(stderr, "Usage: normStreamer id <nodeIdInteger> {send|recv} [addr <addr>[/<port>]]\n"
|
||||
" [interface <name>] [loopback] [info] [ptos <value>] [ex]\n"
|
||||
" [cc|cce|ccl|rate <bitsPerSecond>]\n"
|
||||
" [ack auto|<node1>[,<node2>,...]]\n"
|
||||
" [flush {none|passive|active}]\n"
|
||||
" [listen [<mcastAddr>/]<port>] [linterface <name>]\n"
|
||||
" [relay <dstAddr>/<port>] [limit [<rate>/]<depth>]\n"
|
||||
" [output <device>] [boost] [debug <level>] [trace]\n"
|
||||
" [log <logfile>] [segment <bytes>] [block <count>]\n"
|
||||
" [parity <count>] [auto <count>]\n"
|
||||
" [insockbuffer <bytes>] [outsockbuffer <bytes>]\n"
|
||||
" [txsockbuffer <bytes>] [rxsockbuffer <bytes>]\n"
|
||||
" [streambuffer <bytes>]\n"
|
||||
" [check64 | check32]\n");
|
||||
//" [omit][silent][txloss <lossFraction>]\n");
|
||||
" [check64 | check32]\n"
|
||||
" [omit] [silent] [txloss <lossFraction>]\n");
|
||||
} // end Usage()
|
||||
|
||||
void PrintHelp()
|
||||
|
|
|
|||
Loading…
Reference in New Issue