Esempio n. 1
0
        protected internal virtual bool processReceivedCallMessage(MessageEnvelope message)
        {
            bool result = false;

            if (message != null)
            {
                if (currentCallMessageId.Equals(message.Id))
                {
                    currentCallMessage = message;
                    result             = true;
                }
            }
            if (result)
            {
                callLockEvent.Set();
            }

            if (!result)
            {
                AsyncCallManager mgr             = socketFactory.getTransportFactory().AsyncCallManager;
                AsyncCallItem    callAsyncResult = mgr.getAsyncCall(message);
                if (callAsyncResult != null)
                {
                    result = true;
                    if (callAsyncResult.Listener != null)
                    {
                        callAsyncResult.Listener.onCallResult(callAsyncResult.Request, message);
                    }
                }
            }

            return(result);
        }
Esempio n. 2
0
        public virtual void  callAsync(MessageEnvelope message, ITransportCallListener listener, int timeout)
        {
            AsyncCallManager mgr = socketFactory.getTransportFactory().AsyncCallManager;

            try
            {
                mgr.storeRequest(message, listener, timeout);
                sendAsync(message);
            }
            catch (System.Exception ex)
            {
                mgr.getAsyncCall(message.Id);
                throw ex;
            }
        }