svn commit: r708448 - in /webservices/sandesha/trunk/c: samples/rm_echo_1_0_large_sequence/rm_echo.c src/msgprocessors/app_msg_processor.c

[email protected]
Newsgroups gmane.comp.apache.webservices.fx.devel
Message-ID <[email protected]>
Author: damitha
Date: Mon Oct 27 22:59:44 2008
New Revision: 708448

URL: http://svn.apache.org/viewvc?rev=708448&view=rev
Log:
removing unnecessary sleep in two way message sending thread

Modified:
    webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c

Modified: webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c?rev=708448&r1=708447&r2=708448&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c Mon Oct 27 22:59:44 2008
@@ -30,6 +30,7 @@
 #include <ctype.h>
 #include <neethi_policy.h>
 #include <neethi_util.h>
+#include <unistd.h>
 
 #define SANDESHA2_MAX_COUNT 8
 
@@ -209,7 +210,7 @@
         axis2_callback_set_on_error(callback1, rm_echo_callback_on_error);
         axis2_svc_client_send_receive_non_blocking(svc_client, env, payload, callback1);
         wait_on_callback(env, callback1);
-        AXIS2_SLEEP(1);
+        /*AXIS2_SLEEP(1);*/
     }
     axis2_svc_client_remove_all_headers(svc_client, env);
     property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);

Modified: webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c?rev=708448&r1=708447&r2=708448&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Mon Oct 27 22:59:44 2008
@@ -2355,7 +2355,6 @@
                 status = AXIS2_FAILURE;
                 break;
             }
-
             AXIS2_SLEEP(retrans_interval);
 
             if(transport_sender)
@@ -3625,21 +3624,13 @@
                 seq_prop_mgr, sender_mgr);
     }
 
+    sender_bean = sandesha2_sender_mgr_get_application_msg_to_send(sender_mgr, env, 
+            internal_sequence_id, msg_id);
     /* Resend the application message until timeout or exceed the maximum number of re-sends as
      * specified by Policy.
      */
-    while(AXIS2_TRUE)
+    while(sender_bean)
     {
-        sender_bean = sandesha2_sender_mgr_get_application_msg_to_send(sender_mgr, env, 
-                internal_sequence_id, msg_id);
-        if(!sender_bean)
-        {
-            /* There is no pending message to send. So exit from the thread. */
-            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
-                    "[sandesha2] There is no pending message to send. So exit from the thread");
-            break;
-        }
-
         /*key = sandesha2_sender_bean_get_msg_ctx_ref_key(sender_bean, env);
         app_msg_ctx = sandesha2_storage_mgr_retrieve_msg_ctx(storage_mgr, env, key, conf_ctx, 
                 AXIS2_TRUE);
@@ -3680,7 +3671,19 @@
             sandesha2_sender_bean_free(sender_bean, env); 
         }
 
-        AXIS2_SLEEP(retrans_interval);
+        sender_bean = sandesha2_sender_mgr_get_application_msg_to_send(sender_mgr, env, 
+                internal_sequence_id, msg_id);
+        if(sender_bean)
+        {
+            AXIS2_SLEEP(retrans_interval);
+        }
+        if(!sender_bean)
+        {
+            /* There is no pending message to send. So exit from the thread. */
+            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+                    "[sandesha2] There is no pending message to send. So exit from the thread");
+            break;
+        }
     }
 
     if(app_msg_ctx)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.