version 3.0.4 12/2012/1
authoraa7133@att.com <aa7133@att.com>
Thu, 12 Dec 2019 13:08:56 +0000 (15:08 +0200)
committeraa7133@att.com <aa7133@att.com>
Thu, 12 Dec 2019 13:09:09 +0000 (15:09 +0200)
fix the length bug
add testing (not yet produce the exe)

Change-Id: I37d891a5448a5e1df4b44ff9424251caa654cb1f
Signed-off-by: aa7133@att.com <aa7133@att.com>
.gitignore
RIC-E2-TERMINATION/sctpThread.cpp
T1 [deleted file]

index 2bf45f0..1e8dc13 100644 (file)
@@ -43,3 +43,4 @@ RIC-E2-TERMINATION/concurrentqueue/
 /config/config.conf
 /logTest
 /b64Test
+/T1
index ea48672..2109160 100644 (file)
@@ -289,27 +289,27 @@ void handleTermInit(sctp_params_t &sctpParams) {
     //E2_TERM_INIT
 
     int count = 0;
-    auto exitCond = true;
-    while (exitCond) {
+    while (true) {
         auto xappMessages = num_of_XAPP_messages.load(std::memory_order_acquire);
         if (xappMessages > 0) {
-            exitCond = false;
-            continue;
+            if (mdclog_level_get() >=  MDCLOG_INFO) {
+                mdclog_write(MDCLOG_INFO, "Got a message from some appliction, stop sending E@_TERM_INIT");
+            }
+            return;
         }
-        usleep(10000);
+        usleep(100000);
         count++;
-        if (count % 100 == 0) {
-            mdclog_write(MDCLOG_ERR, "No messages from any xApp : %ld", xappMessages);
+        if (count % 1000 == 0) {
+            mdclog_write(MDCLOG_ERR, "GOT No messages from any xApp");
             sendTermInit(sctpParams);
         }
     }
 }
 
 void sendTermInit(sctp_params_t &sctpParams) {
-    auto term_init = false;
     rmr_mbuf_t *msg = rmr_alloc_msg(sctpParams.rmrCtx, sctpParams.ka_message_length);
     auto count = 0;
-    while (!term_init) {
+    while (true) {
         msg->mtype = E2_TERM_INIT;
         msg->state = 0;
         rmr_bytes2payload(msg, (unsigned char *)sctpParams.ka_message, sctpParams.ka_message_length);
@@ -320,9 +320,11 @@ void sendTermInit(sctp_params_t &sctpParams) {
         if (msg == nullptr) {
             msg = rmr_alloc_msg(sctpParams.rmrCtx, sctpParams.myIP.length());
         } else if (msg->state == 0) {
-            term_init = true;
             rmr_free_msg(msg);
-            //break;
+            if (mdclog_level_get() >=  MDCLOG_INFO) {
+                mdclog_write(MDCLOG_INFO, "E2_TERM_INIT succsesfuly sent ");
+            }
+            return;
         } else {
             if (count % 100 == 0) {
                 mdclog_write(MDCLOG_ERR, "Error sending E2_TERM_INIT cause : %d ", msg->state);
diff --git a/T1 b/T1
deleted file mode 100755 (executable)
index 0d181f4..0000000
Binary files a/T1 and /dev/null differ