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(); } }
internal void Bind(ConsumedCapability cap) { if (ConsumedCap != null) { throw new InvalidOperationException("Proxy was already bound"); } if (cap == null) { return; } ConsumedCap = cap; cap.AddRef(); }
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(); } }