added examples/chant.cpp for simple command-line NORM chat app

pull/82/head
bebopagogo 2023-06-03 23:05:39 -04:00
parent 34e582bfac
commit 69a9e4828d
1 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ class ChantClient : public ProtoTree::Item
unsigned int GetKeysize() const {return (sizeof(NormNodeHandle) << 3);} unsigned int GetKeysize() const {return (sizeof(NormNodeHandle) << 3);}
NormNodeHandle node_handle; NormNodeHandle node_handle;
char chat_name[CHAT_NAME_MAX+1]; // from NORM_INFO char chat_name[CHAT_NAME_MAX+1]; // conveyed via NORM_INFO
NormObjectHandle rx_stream; NormObjectHandle rx_stream;
bool msg_sync; bool msg_sync;
char rx_buffer[MSG_SIZE_MAX+1]; char rx_buffer[MSG_SIZE_MAX+1];
@ -541,6 +541,7 @@ void ChantCommand::ReadInput()
NormSetWatermark(norm_session, tx_stream, true); NormSetWatermark(norm_session, tx_stream, true);
tx_ack_pending = false; tx_ack_pending = false;
} }
input_needed = false;
} }
else else
{ {
@ -934,7 +935,7 @@ int main(int argc, char* argv[])
unsigned int ackingNodeCount = 0; unsigned int ackingNodeCount = 0;
bool loopback = false; bool loopback = false;
bool ftiInfo = false; bool ftiInfo = true;
int debugLevel = 0; int debugLevel = 0;
bool trace = false; bool trace = false;
const char* logFile = NULL; const char* logFile = NULL;
@ -948,7 +949,6 @@ int main(int argc, char* argv[])
ChantCommand chant; ChantCommand chant;
chant.SetFlushMode(NORM_FLUSH_ACTIVE); chant.SetFlushMode(NORM_FLUSH_ACTIVE);
chant.SetFtiInfo(true); // set true by default to reduce per-packet overhead
chant.SetAutoAck(true); // more succinct flushing chant.SetAutoAck(true); // more succinct flushing
// Parse command-line // Parse command-line