コード例 #1
0
        internal PendingQuestion(IRpcEndpoint ep, uint id, ConsumedCapability target, SerializerState?inParams)
        {
            RpcEndpoint   = ep ?? throw new ArgumentNullException(nameof(ep));
            _questionId   = id;
            _target       = target;
            _inParams     = inParams;
            _whenReturned = _tcs.Task.EnforceAwaitOrder();

            StateFlags = inParams == null ? State.Sent : State.None;

            if (target != null)
            {
                target.AddRef();
            }
        }
コード例 #2
0
ファイル: Proxy.cs プロジェクト: inu4g0t/capnproto-dotnetcore
        internal void Bind(ConsumedCapability cap)
        {
            if (ConsumedCap != null)
            {
                throw new InvalidOperationException("Proxy was already bound");
            }

            if (cap == null)
            {
                return;
            }

            ConsumedCap = cap;
            cap.AddRef();
        }
コード例 #3
0
        internal PendingQuestion(IRpcEndpoint ep, uint id, ConsumedCapability target, SerializerState inParams)
        {
            RpcEndpoint = ep ?? throw new ArgumentNullException(nameof(ep));
            _questionId = id;
            _target     = target;
            _inParams   = inParams;
            StateFlags  = inParams == null ? State.Sent : State.None;

            if (inParams != null)
            {
                foreach (var cap in inParams.Caps)
                {
                    cap?.AddRef();
                }
            }

            if (target != null)
            {
                target.AddRef();
            }
        }