Esempio n. 1
0
        private void ErrorArrived(long requestId, Action <WampRpcInvocation> action)
        {
            WampRpcInvocation invocation = GetInvocation(requestId);

            if (invocation != null)
            {
                action(invocation);
            }
        }
        private void UnregisterInvocation(WampRpcInvocation invocation)
        {
            lock (mLock)
            {
                WampRpcInvocation removedInvocation;

                mRequestIdToInvocation.TryRemove(invocation.InvocationId, out removedInvocation);
                mCallbackToInvocations.Remove(invocation.Callback, invocation);
                mOperationToInvocations.Remove(invocation.Operation, invocation);
            }
        }
Esempio n. 3
0
        private void ResultArrived(IWampCallee callee, long requestId, YieldOptions options, Action <WampRpcInvocation> action)
        {
            WampRpcInvocation invocation = GetInvocation(requestId, options);

            if (invocation != null)
            {
                if (invocation.Operation.Callee == callee)
                {
                    action(invocation);
                }
                else
                {
                    callee.InvocationError(requestId, mEmptyDetails, WampErrors.NotAuthorized);
                }
            }
        }
Esempio n. 4
0
        private void UnregisterInvocation(WampRpcInvocation invocation)
        {
            lock (mLock)
            {
                mRequestIdToInvocation.TryRemove(invocation.InvocationId, out WampRpcInvocation removedInvocation);

                IWampCaller caller = GetCaller(invocation.Callback);

                if (caller != null)
                {
                    mCallerToInvocations.Remove(caller, invocation);
                }

                mOperationToInvocations.Remove(invocation.Operation, invocation);
                mCallbackToInvocation.Remove(invocation.Callback);
            }
        }
        public long RegisterInvocation(RemoteWampCalleeDetails operation, IWampRawRpcOperationRouterCallback callback, InvocationDetails options, object[] arguments = null, IDictionary <string, object> argumentsKeywords = null)
        {
            lock (mLock)
            {
                WampRpcInvocation invocation =
                    new WampRpcInvocation
                        (operation, callback, options, arguments, argumentsKeywords);

                if (!mCallbackToInvocations.ContainsKey(callback))
                {
                    RegisterDisconnectionNotifier(callback);
                }

                long invocationId = mRequestIdToInvocation.Add(invocation);

                invocation.InvocationId = invocationId;

                mOperationToInvocations.Add(operation, invocation);
                mCallbackToInvocations.Add(callback, invocation);

                return(invocationId);
            }
        }
Esempio n. 6
0
        public long RegisterInvocation(RemoteWampCalleeDetails operation, IWampRawRpcOperationRouterCallback callback, InvocationDetails options, object[] arguments = null, IDictionary <string, object> argumentsKeywords = null)
        {
            lock (mLock)
            {
                WampRpcInvocation invocation =
                    new WampRpcInvocation
                        (operation, callback, options, arguments, argumentsKeywords);

                long invocationId = mRequestIdToInvocation.Add(invocation);

                invocation.InvocationId = invocationId;

                mOperationToInvocations.Add(operation, invocation);

                IWampCaller caller = GetCaller(callback);

                if (caller != null)
                {
                    if (!mCallerToInvocations.ContainsKey(caller))
                    {
                        RegisterDisconnectionNotifier(callback);
                    }

                    mCallerToInvocations.Add(caller, invocation);
                }

                IWampClientProperties properties = invocation.Operation.Callee as IWampClientProperties;

                if (properties.HelloDetails?.Roles?.Callee?.Features?.CallCanceling == true)
                {
                    mCallbackToInvocation.Add(callback, invocation);
                }

                return(invocationId);
            }
        }