[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/bisocket ...
Ron Sigal
ron_sigal at yahoo.com
Sun Aug 5 23:55:32 EDT 2007
User: rsigal
Date: 07/08/05 23:55:32
Modified: src/main/org/jboss/remoting/transport/bisocket Tag:
remoting_2_2_0_GA BisocketClientInvoker.java
Log:
JBREM-766: Put wait() in a loop in handleConnect() and createSocket().
Revision Changes Path
No revision
No revision
1.1.2.13.2.12 +27 -11 JBossRemoting/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BisocketClientInvoker.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java,v
retrieving revision 1.1.2.13.2.11
retrieving revision 1.1.2.13.2.12
diff -u -b -r1.1.2.13.2.11 -r1.1.2.13.2.12
--- BisocketClientInvoker.java 5 Aug 2007 04:08:51 -0000 1.1.2.13.2.11
+++ BisocketClientInvoker.java 6 Aug 2007 03:55:32 -0000 1.1.2.13.2.12
@@ -246,14 +246,22 @@
{
if (sockets.isEmpty())
{
+ long wait = timeout;
+ long start = System.currentTimeMillis();
+
+ while (timeout == 0 || wait > 0)
+ {
try
{
- sockets.wait(timeout);
+ sockets.wait(wait);
+ break;
}
- catch (InterruptedException ignored)
+ catch (InterruptedException e)
{
- log.warn("unexpected interrupt");
-// throw new InterruptedIOException("Attempt to create control socket interrupted");
+ log.debug("unexpected interrupt");
+ if (timeout > 0)
+ wait = timeout - (System.currentTimeMillis() - start);
+ }
}
}
@@ -440,14 +448,22 @@
{
if (sockets.isEmpty())
{
+ long wait = timeout;
+ long start = System.currentTimeMillis();
+
+ while (timeout == 0 || wait > 0)
+ {
try
{
- sockets.wait(timeout);
+ sockets.wait(wait);
+ break;
}
catch (InterruptedException e)
{
- log.warn("unexpected interrupt");
- throw new InterruptedIOException("Attempt to create callback socket interrupted");
+ log.debug("unexpected interrupt");
+ if (timeout > 0)
+ wait = timeout - (System.currentTimeMillis() - start);
+ }
}
}
More information about the jboss-cvs-commits
mailing list