*** GIOPConnection.java@@/main/1 Mon Oct 31 12:30:42 2005 --- GIOPConnection.java@@/main/3 Wed Jul 19 11:38:11 2006 *************** *** 29,34 **** --- 29,35 ---- import org.omg.GIOP.*; import org.omg.CORBA.NO_IMPLEMENT; import org.omg.CORBA.CompletionStatus; + import org.omg.CORBA.COMM_FAILURE; import org.omg.ETF.*; import org.jacorb.orb.SystemExceptionHelper; *************** *** 377,392 **** } else { ! if (logger.isErrorEnabled()) { ! logger.error( "Failed to read GIOP message, incorrect magic number" ); } ! if (logger.isDebugEnabled()) { ! logger.debug("GIOPConnection.getMessage()" + msg_header.value ); } ! return null; } } --- 378,397 ---- } else { ! if (logger.isDebugEnabled()) { ! logger.debug("GIOPConnection.getMessage(): invalid header read: " + msg_header.value ); } ! if (logger.isErrorEnabled()) { ! logger.error( "Failed to read GIOP message, incorrect magic number --> connection closed" ); } ! //close transport connection, there is nearly no chance to sync with ! //peer on this connection again ! close(); ! //signal GIOPConnectionManager to throw this connection away ! this.streamClosed(); return null; } } *************** *** 857,862 **** --- 862,887 ---- getStatisticsProvider().flushed(); } } + catch ( COMM_FAILURE e ) + { + if (logger.isErrorEnabled()) + { + logger.error( "Failed to write GIOP message due to COMM_FAILURE", e ); + } + if( !do_close ) + { + if (logger.isErrorEnabled()) + { + logger.error( "GIOP connection closed due to errors during sendMessage"); + } + //close transport connection, there is nearly no chance to sync with + //peer on this connection again + close(); + //signal GIOPConnectionManager to throw this connection away + this.streamClosed(); + } + throw e; + } finally { decPendingWrite();