This results more stable work with ORBit.
2006-04-09 Audrius Meskauskas <[EMAIL PROTECTED]
* gnu/CORBA/gnuRequest.java (submit): Do not read any response after
one way message and retry after any IOException.
Index: gnuRequest.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/CORBA/gnuRequest.java,v
retrieving revision 1.20
diff -u -r1.20 gnuRequest.java
--- gnuRequest.java 9 Apr 2006 09:50:32 -0000 1.20
+++ gnuRequest.java 9 Apr 2006 16:53:33 -0000
@@ -594,7 +594,7 @@
{
final gnuRequest cloned = Clone();
cloned.oneWay = true;
-
+
new Thread()
{
public void run()
@@ -788,20 +788,21 @@
if (socket == null)
{
- // The BindException may be thrown under very heavy parallel
+ // The IOException may be thrown under very heavy parallel
// load. For some time, just wait, exceptiong the socket to free.
Open: for (int i = 0; i < PAUSE_STEPS; i++)
{
try
{
if (orb instanceof OrbFunctional)
- socket = ((OrbFunctional) orb).socketFactory.createClientSocket(
- ior.Internet.host, ior.Internet.port);
+ socket = ((OrbFunctional) orb).socketFactory.
+ createClientSocket(
+ ior.Internet.host, ior.Internet.port);
else
socket = new Socket(ior.Internet.host, ior.Internet.port);
break Open;
}
- catch (BindException ex)
+ catch (IOException ex)
{
try
{
@@ -833,23 +834,11 @@
request_part.buffer.writeTo(socketOutput);
socketOutput.flush();
- if (!socket.isClosed())
+ if (!socket.isClosed() && !oneWay)
{
MessageHeader response_header = new MessageHeader();
InputStream socketInput = socket.getInputStream();
- try
- {
- response_header.read(socketInput);
- }
- catch (MARSHAL eof)
- {
- // If the message is sent one way, we do not care about the
- // response that may never come.
- if (oneWay && eof.minor == Minor.EOF)
- return EMPTY;
- else
- throw eof;
- }
+ response_header.read(socketInput);
byte[] r;
if (orb instanceof OrbFunctional)