src/js/lib/RTRemoteProtocol.js
/**
   * send request message to other side
   * @param {object} messageObj the message object
   * @return {Promise<object>} the promise with returned rtValue
   */
send request message to other side
@param {object} messageObj the message object
@return {Promise} the promise with returned rtValue
send request message to other side @param { object } messageObj the message object @return { Promise } the promise with returned rtValue
sendRequestMessage(messageObj) {
    const callContext = {};
    this.futures[messageObj[RTConst.CORRELATION_KEY]] = callContext;
    this.transport.send(RTRemoteSerializer.toBuffer(messageObj));
    return new Promise((resolve, reject) => {
      callContext.resolve = resolve;
      callContext.reject = reject;
      callContext.expired = false;
      callContext.timeoutHandler = setTimeout(() => {
        callContext.expired = true;
        reject(new RTException(helper.getStatusStringByCode(RTStatusCode.TIMEOUT)));
      }, RTConst.REQUEST_TIMEOUT);
    });
  }
sendRequestMessage ( messageObj ) { const callContext = { } ; this . futures [ messageObj [ RTConst . CORRELATION_KEY ] ] = callContext ; this . transport . send ( RTRemoteSerializer . toBuffer ( messageObj ) ) ; return new Promise ( ( resolve , reject ) => { callContext . resolve = resolve ; callContext . reject = reject ; callContext . expired = false ; callContext . timeoutHandler = setTimeout ( ( ) => { callContext . expired = true ; reject ( new RTException ( helper . getStatusStringByCode ( RTStatusCode . TIMEOUT ) ) ) ; } , RTConst . REQUEST_TIMEOUT ) ; } ) ; }
send request message to other side
 @param {object} messageObj the message object
 @return {Promise<object>} the promise with returned rtValue
send request message to other side @param { object } messageObj the message object @return { Promise<object > } the promise with returned rtValue