You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/12/12 23:45:18 UTC

svn commit: r356405 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java

Author: dims
Date: Mon Dec 12 14:45:14 2005
New Revision: 356405

URL: http://svn.apache.org/viewcvs?rev=356405&view=rev
Log:
infinite timeout (set the parameter as -1) - good for debugging



Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java?rev=356405&r1=356404&r2=356405&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/InOutMEPClient.java Mon Dec 12 14:45:14 2005
@@ -111,17 +111,28 @@
             SyncCallBack callback = new SyncCallBack();
             //this method call two channel non blocking method to do the work and wait on the callbck
             invokeNonBlocking(axisop, msgctx, callback);
-            long index = clientOptions.getTimeOutInMilliSeconds() / 100;
-            while (!callback.isComplete()) {
-                //wait till the reponse arrives
-                if (index-- >= 0) {
+            long timeout = clientOptions.getTimeOutInMilliSeconds();
+            if (timeout < 0) {
+                while (!callback.isComplete()) {
                     try {
                         Thread.sleep(100);
                     } catch (InterruptedException e) {
                         throw new AxisFault(e);
                     }
-                } else {
-                    throw new AxisFault(Messages.getMessage("responseTimeOut"));
+                }
+            } else {
+                long index = timeout / 100;
+                while (!callback.isComplete()) {
+                    //wait till the reponse arrives
+                    if (index-- >= 0) {
+                        try {
+                            Thread.sleep(100);
+                        } catch (InterruptedException e) {
+                            throw new AxisFault(e);
+                        }
+                    } else {
+                        throw new AxisFault(Messages.getMessage("responseTimeOut"));
+                    }
                 }
             }
             //process the resule of the invocation