Author: ron.sigal(a)jboss.com
Date: 2009-09-14 15:53:20 -0400 (Mon, 14 Sep 2009)
New Revision: 5473
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java
Log:
JBREM-1147, JBREM-1152: If createSocket() fails to write Bisocket.CREATE_ORDINARY_SOCKET,
it should timeout before returning, which gives the control connection a chance to be
recreated.
Modified:
remoting2/branches/2.2/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java
===================================================================
---
remoting2/branches/2.2/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java 2009-09-14
18:54:46 UTC (rev 5472)
+++
remoting2/branches/2.2/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java 2009-09-14
19:53:20 UTC (rev 5473)
@@ -484,6 +484,8 @@
}
}
+ IOException savedException = null;
+
synchronized (controlLock)
{
if (log.isTraceEnabled()) log.trace(this + " writing
Bisocket.CREATE_ORDINARY_SOCKET on " + controlOutputStream);
@@ -507,7 +509,7 @@
catch (IOException e)
{
log.debug(this + " unable to write
Bisocket.CREATE_ORDINARY_SOCKET", e);
- throw e;
+ savedException = e;
}
}
@@ -571,6 +573,11 @@
throw new SocketException("Unable to create socket");
}
+ if (savedException != null)
+ {
+ throw savedException;
+ }
+
throw new SocketException("Timed out trying to create socket");
}