diff --git a/examples/normClient.cpp b/examples/normClient.cpp index 86e8d47..7952f97 100644 --- a/examples/normClient.cpp +++ b/examples/normClient.cpp @@ -27,7 +27,7 @@ void Usage() { - fprintf(stderr, "Usage: normClient [connect [/][,]][debug ][trace]\n"); + fprintf(stderr, "Usage: normClient [connect /[,]][debug ][trace]\n"); } const unsigned int MSG_LENGTH_MAX = 64; @@ -257,9 +257,10 @@ int main(int argc, char* argv[]) { // Input stream has likely closed, initiate client shutown // TBD - initiate client shutdown - if (NULL == groupAddrPtr) + //if (NULL == groupAddrPtr) { - fprintf(stderr, "normClient: CLOSING connection to server ...\n"); + fprintf(stderr, "normClient: CLOSING connection to %sserver ...\n", + (NULL != groupAddrPtr) ? : "multicast " : ""); NormShutdown(normSocket); } inputNeeded = false; // TBD -should we also fclose(inputFile)??? @@ -277,9 +278,10 @@ int main(int argc, char* argv[]) else if (feof(inputFile)) { // TBD - initiate client shutdown - if (NULL == groupAddrPtr) + //if (NULL == groupAddrPtr) { - fprintf(stderr, "normClient: CLOSING connection to server ...\n"); + fprintf(stderr, "normClient: CLOSING connection to %sserver ...\n", + (NULL != groupAddrPtr) ? "multicast " : ""); NormShutdown(normSocket); } inputNeeded = false; // TBD -should we also fclose(inputFile)??? @@ -326,9 +328,12 @@ int main(int argc, char* argv[]) unsigned int addrLen = 16; UINT16 remotePort; NormGetPeerName(normSocket, remoteAddr, &addrLen, &remotePort); - fprintf(stderr, "normClient: CONNECTED to server %s/%hu\n", serverAddr, remotePort); + fprintf(stderr, "normClient: CONNECTED to %sserver %s/%hu\n", + (NULL != groupAddrPtr) ? "multicast " : "", serverAddr, remotePort); inputNeeded = true; writeReady = true; + if (trace && (NULL != groupAddrPtr)) + NormSetMessageTrace(NormGetSocketMulticastSession(normSocket), true); break; } case NORM_SOCKET_READ: @@ -366,13 +371,15 @@ int main(int argc, char* argv[]) writeReady = true; break; case NORM_SOCKET_CLOSING: - fprintf(stderr, "normClient: server CLOSING connection ...\n"); + fprintf(stderr, "normClient: %sserver CLOSING connection ...\n", + (NULL != groupAddrPtr) ? "multicast " : ""); writeReady = false; inputNeeded = false; break; case NORM_SOCKET_CLOSE: { - fprintf(stderr, "normClient: connection to server CLOSED.\n"); + fprintf(stderr, "normClient: connection to %sserver CLOSED.\n", + (NULL != groupAddrPtr) ? "multicast " : ""); writeReady = false; inputNeeded = false; keepGoing = false; diff --git a/src/common/normSession.cpp b/src/common/normSession.cpp index 6cc0855..b857f31 100644 --- a/src/common/normSession.cpp +++ b/src/common/normSession.cpp @@ -1145,11 +1145,7 @@ void NormSession::Serve() NormBlock* block = nextObj->FindBlock(nextBlockId); if (block) { -#ifdef PROTO_DEBUG - ASSERT(block->GetFirstPending(nextSegmentId)); -#else block->GetFirstPending(nextSegmentId); -#endif // if/else PROTO_DEBUG // Adjust so watermark segmentId < block length UINT16 nextBlockSize = nextObj->GetBlockSize(nextBlockId); if (nextSegmentId >= nextBlockSize) nextSegmentId = nextBlockSize - 1; @@ -2243,7 +2239,10 @@ void NormSession::TxSocketRecvHandler(ProtoSocket& theSocket, else { // Probably an ICMP "port unreachable" error - if (Address().IsUnicast()) + // Note we purposefull do _not_ set the "posted_send_error" + // status here because we do not want this notification + // cleared due to SEND_OK status since it's receiver driven + if (Address().IsUnicast()) Notify(NormController::SEND_ERROR, NULL, NULL); break; } @@ -2361,6 +2360,9 @@ void NormSession::RxSocketRecvHandler(ProtoSocket& theSocket, else { // Probably an ICMP "port unreachable" error + // Note we purposefull do _not_ set the "posted_send_error" + // status here because we do not want this notification + // cleared due to SEND_OK status since it's receiver driven if (Address().IsUnicast()) Notify(NormController::SEND_ERROR, NULL, NULL); break;