/** * Writes RMI protocol header and RMI protocol version to the open OutputStream. * * @param dout DataOutputStream to write header to * @throws RemoteException if any I/O error occurred while writing header */ protected void writeHeader(DataOutputStream dout) throws RemoteException { try { dout.writeInt(RMI_HEADER); dout.writeShort(PROTOCOL_VER); } catch (IOException ioe) { // rmi.41=Unable to write RMI protocol header throw new ConnectIOException(Messages.getString("rmi.41"), ioe); // $NON-NLS-1$ } if (transportLog.isLoggable(RMILog.VERBOSE)) { // rmi.log.94=Using protocol version {0} transportLog.log( RMILog.VERBOSE, Messages.getString( "rmi.log.94", //$NON-NLS-1$ PROTOCOL_VER)); } }
/** * Opens a connection to the given Endpoint and writes DGC ack there. * * @param uid UID to be send */ public void sendDGCAck(UID uid) { ClientConnection conn = null; try { conn = ClientConnectionManager.getConnection(ep); DataOutputStream dout = new DataOutputStream(out); dout.writeByte(RMIProtocolConstants.DGCACK_MSG); uid.write(dout); dout.flush(); conn.releaseOutputStream(); conn.done(); } catch (IOException ioe) { if (conn != null) { conn.close(); } } if (dgcLog.isLoggable(RMILog.VERBOSE)) { // rmi.log.93=Sent DGC ack to {0} for {1} dgcLog.log(RMILog.VERBOSE, Messages.getString("rmi.log.93", ep, uid)); // $NON-NLS-1$ } }