private Packet sendSessionControlMessage(final String messageName, final Packet request) throws RxRuntimeException {
int attempt = 0;
Packet response = null;
while (true) {
if (attempt > rc.configuration.getRmFeature().getMaxRmSessionControlMessageResendAttempts()) {
throw new RxRuntimeException(LocalizationMessages.WSRM_1128_MAX_RM_SESSION_CONTROL_MESSAGE_RESEND_ATTEMPTS_REACHED(messageName));
}
try {
response = rc.communicator.send(request.copy(true));
break;
} catch (RuntimeException ex) {
if (!Utilities.isResendPossible(ex)) {
throw new RxRuntimeException(LocalizationMessages.WSRM_1106_SENDING_RM_SESSION_CONTROL_MESSAGE_FAILED(messageName), ex);
} else {
LOGGER.warning(LocalizationMessages.WSRM_1106_SENDING_RM_SESSION_CONTROL_MESSAGE_FAILED(messageName), ex);
}
}
attempt++;