src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPChannel.java

Print this page




 279                      * connection.  NOTE: this timeout, if configured to a
 280                      * finite duration, places an upper bound on the time
 281                      * that a remote method call is permitted to execute.
 282                      */
 283                     try {
 284                         /*
 285                          * If socket factory had set a non-zero timeout on its
 286                          * own, then restore it instead of using the property-
 287                          * configured value.
 288                          */
 289                         sock.setSoTimeout((originalSoTimeout != 0 ?
 290                                            originalSoTimeout :
 291                                            responseTimeout));
 292                     } catch (Exception e) {
 293                         // if we fail to set this, ignore and proceed anyway
 294                     }
 295 
 296                     out.flush();
 297                 }
 298             } catch (IOException e) {
 299                 if (e instanceof RemoteException) {
 300                     throw (RemoteException) e;
 301                 } else {
 302                     if (conn != null
 303                             && e instanceof java.net.SocketTimeoutException)
 304                     {
 305                         try {
 306                             conn.close();
 307                         } catch (Exception ex) {}
 308                     }


 309                     throw new ConnectIOException(
 310                         "error during JRMP connection establishment", e);
 311                 }
 312             }
 313         } else {
 314             try {
 315                 conn = multiplexer.openConnection();
 316             } catch (IOException e) {
 317                 synchronized (this) {
 318                     usingMultiplexer = false;
 319                     multiplexer = null;
 320                 }
 321                 throw new ConnectIOException(
 322                     "error opening virtual connection " +
 323                     "over multiplexed connection", e);
 324             }
 325         }
 326         return conn;
 327     }
 328 




 279                      * connection.  NOTE: this timeout, if configured to a
 280                      * finite duration, places an upper bound on the time
 281                      * that a remote method call is permitted to execute.
 282                      */
 283                     try {
 284                         /*
 285                          * If socket factory had set a non-zero timeout on its
 286                          * own, then restore it instead of using the property-
 287                          * configured value.
 288                          */
 289                         sock.setSoTimeout((originalSoTimeout != 0 ?
 290                                            originalSoTimeout :
 291                                            responseTimeout));
 292                     } catch (Exception e) {
 293                         // if we fail to set this, ignore and proceed anyway
 294                     }
 295 
 296                     out.flush();
 297                 }
 298             } catch (IOException e) {






 299                 try {
 300                     conn.close();
 301                 } catch (Exception ex) {}
 302                 if (e instanceof RemoteException) {
 303                     throw (RemoteException) e;
 304                 } else {
 305                     throw new ConnectIOException(
 306                         "error during JRMP connection establishment", e);
 307                 }
 308             }
 309         } else {
 310             try {
 311                 conn = multiplexer.openConnection();
 312             } catch (IOException e) {
 313                 synchronized (this) {
 314                     usingMultiplexer = false;
 315                     multiplexer = null;
 316                 }
 317                 throw new ConnectIOException(
 318                     "error opening virtual connection " +
 319                     "over multiplexed connection", e);
 320             }
 321         }
 322         return conn;
 323     }
 324