int ack = din.readByte();
if (ack != PROTOCOL_ACK) {
// rmi.log.137=Protocol version {0} is not supported.
// rmi.log.13C=Unknown protocol response: {0}
throw new ConnectIOException((ack == PROTOCOL_NOT_SUPPORTED)
? (Messages.getString("rmi.log.137", STREAM_PROTOCOL)) //$NON-NLS-1$
: (Messages.getString("rmi.log.13C",ack))); //$NON-NLS-1$
}
// read host and port
String host = din.readUTF();
int port = din.readInt();
if (tcpTransportLog.isLoggable(RMILog.VERBOSE)) {
// rmi.log.138=Server is seeing us as {0}:{1}
tcpTransportLog.log(RMILog.VERBOSE,
Messages.getString("rmi.log.138", host, port)); //$NON-NLS-1$
}
// restore original value of soTimeout
try {
s.setSoTimeout(origTimeout);
} catch (Exception ex) {
}
// send our host and port (for Stream protocol they'll be ignored)
dout.writeUTF(host);
dout.writeInt(port);
dout.flush();
} catch (RemoteException re) {
close();
throw re;
} catch (IOException ioe) {
close();
// rmi.92=Unable to acknowledge protocol with server
throw new ConnectIOException(
Messages.getString("rmi.92"), ioe); //$NON-NLS-1$
}
// protocol is agreed
return STREAM_PROTOCOL;