Esempio n. 1
0
        private static IWampCaller GetCaller(IWampRawRpcOperationRouterCallback callback)
        {
            IWampCaller caller = null;
            WampRpcOperationCallback operationCallback = callback as WampRpcOperationCallback;

            if (operationCallback != null)
            {
                caller = operationCallback.Caller;
            }
            return(caller);
        }
Esempio n. 2
0
        public void Cancel(IWampCaller caller, long requestId, CancelOptions options)
        {
            WampRpcOperationCallback callback = new WampRpcOperationCallback(caller, requestId);

            lock (mLock)
            {
                if (mCallbackToInvocation.TryGetValue(callback, out WampRpcInvocation invocation))
                {
                    IWampCallee callee = invocation.Operation.Callee;

                    callee.Interrupt(invocation.InvocationId, new InterruptDetails()
                    {
                        Mode = options.Mode
                    });
                }
            }
        }
Esempio n. 3
0
        private void OnCallbackDisconnected(object sender, EventArgs e)
        {
            UnregisterDisconnectionNotifier(sender);

            WampRpcOperationCallback callback =
                sender as WampRpcOperationCallback;


            lock (mLock)
            {
                if (mCallerToInvocations.TryGetValue(callback.Caller, out ICollection <WampRpcInvocation> invocations))
                {
                    foreach (WampRpcInvocation invocation in invocations.ToArray())
                    {
                        UnregisterInvocation(invocation);
                    }
                }
            }
        }
Esempio n. 4
0
 protected bool Equals(WampRpcOperationCallback other)
 {
     return(Session == other.Session && RequestId == other.RequestId);
 }
 protected bool Equals(WampRpcOperationCallback other)
 {
     return(Equals(mCaller, other.mCaller));
 }