src/main/java/com/github/mikesafonov/smpp/core/sender/StandardSenderClient.java
@Override
    public @NotNull CancelMessageResponse cancel(@NotNull CancelMessage cancelMessage) {

        requireNonNull(cancelMessage);
        if (isNullOrEmpty(cancelMessage.getMessageId())) {
            return CancelMessageResponse.error(cancelMessage, getId(), new MessageErrorInformation(0, "Empty message id"));
        }

        try {
            checkSession();

            CancelSm cancelSm = messageBuilder.createCancelSm(cancelMessage);
            WindowFuture<Integer, PduRequest, PduResponse> futureResponse = session.sendRequestPdu(cancelSm, timeoutMillis, true);
            if (futureResponse.await() && futureResponse.isDone() && futureResponse.isSuccess()) {
                return createCancelMessageResponse(cancelMessage, futureResponse);
            }
            return CancelMessageResponse.error(cancelMessage, getId(), new MessageErrorInformation(INVALID_PARAM, "Unable to get response"));
        } catch (RecoverablePduException | UnrecoverablePduException | SmppTimeoutException | SmppChannelException | InterruptedException e) {
            log.error(e.getMessage(), e);
            return CancelMessageResponse.error(cancelMessage, getId(), new MessageErrorInformation(INVALID_PARAM, e.getMessage()));
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return CancelMessageResponse.error(cancelMessage, getId(), new MessageErrorInformation(INVALID_SENDING_ERROR, "Unexpected exception"));
        }
    }
/**
     * Cancel smsc message
     *
     * @param cancelMessage message to cancel
     * @return cancel response
     */
Cancel smsc message
@param cancelMessage message to cancel
@return cancel response
Cancel smsc message @param cancelMessage message to cancel @return cancel response
@Override
    public @NotNull CancelMessageResponse cancel(@NotNull CancelMessage cancelMessage) {
        requireNonNull(cancelMessage);
        if (isNullOrEmpty(cancelMessage.getMessageId())) {
            return CancelMessageResponse.error(cancelMessage, getId(), new MessageErrorInformation(0, "Empty message id"));
        }
        try {
            checkSession();
            CancelSm cancelSm = messageBuilder.createCancelSm(cancelMessage);
            WindowFuture<Integer, PduRequest, PduResponse> futureResponse = session.sendRequestPdu(cancelSm, timeoutMillis, true);
            if (futureResponse.await() && futureResponse.isDone() && futureResponse.isSuccess()) {
                return createCancelMessageResponse(cancelMessage, futureResponse);
            }
            return CancelMessageResponse.error(cancelMessage, getId(), new MessageErrorInformation(INVALID_PARAM, "Unable to get response"));
        } catch (RecoverablePduException | UnrecoverablePduException | SmppTimeoutException | SmppChannelException | InterruptedException e) {
            log.error(e.getMessage(), e);
            return CancelMessageResponse.error(cancelMessage, getId(), new MessageErrorInformation(INVALID_PARAM, e.getMessage()));
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return CancelMessageResponse.error(cancelMessage, getId(), new MessageErrorInformation(INVALID_SENDING_ERROR, "Unexpected exception"));
        }
    }
@ Override public @ NotNull CancelMessageResponse cancel ( @ NotNull CancelMessage cancelMessage ) { requireNonNull ( cancelMessage ) ; if ( isNullOrEmpty ( cancelMessage . getMessageId ( ) ) ) { return CancelMessageResponse . error ( cancelMessage , getId ( ) , new MessageErrorInformation ( 0 , "Empty message id" ) ) ; } try { checkSession ( ) ; CancelSm cancelSm = messageBuilder . createCancelSm ( cancelMessage ) ; WindowFuture < Integer , PduRequest , PduResponse > futureResponse = session . sendRequestPdu ( cancelSm , timeoutMillis , true ) ; if ( futureResponse . await ( ) && futureResponse . isDone ( ) && futureResponse . isSuccess ( ) ) { return createCancelMessageResponse ( cancelMessage , futureResponse ) ; } return CancelMessageResponse . error ( cancelMessage , getId ( ) , new MessageErrorInformation ( INVALID_PARAM , "Unable to get response" ) ) ; } catch ( RecoverablePduException | UnrecoverablePduException | SmppTimeoutException | SmppChannelException | InterruptedException e ) { log . error ( e . getMessage ( ) , e ) ; return CancelMessageResponse . error ( cancelMessage , getId ( ) , new MessageErrorInformation ( INVALID_PARAM , e . getMessage ( ) ) ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; return CancelMessageResponse . error ( cancelMessage , getId ( ) , new MessageErrorInformation ( INVALID_SENDING_ERROR , "Unexpected exception" ) ) ; } }
Cancel smsc message
 @param cancelMessage message to cancel
 @return cancel response
Cancel smsc message @param cancelMessage message to cancel @return cancel response