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); }
public virtual void storeRequest(MessageEnvelope request, ITransportCallListener listener, int timeout) { AsyncCallItem item = new AsyncCallItem(); item.Request = request; item.Listener = listener; item.Timeout = timeout; lock (asyncCalls) { asyncCalls.Add(request.Id, item); } }
public virtual AsyncCallItem getAsyncCall(System.String id) { AsyncCallItem res = null; lock (asyncCalls) { if (asyncCalls.ContainsKey(id)) { res = asyncCalls[id]; } if (res != null) { asyncCalls.Remove(id); } } return(res); }