private void PacketReceived(RpcEnvelope envelope) { PendingRequest pending; if (m_RequestsPending.TryGetValue(envelope.RequestId, out pending)) { pending.PacketReceived(envelope); } }
public override TResponse BlockingUnaryCall <TRequest, TResponse>(Method <TRequest, TResponse> method, string host, CallOptions options, TRequest request) { byte[] msg = method.RequestMarshaller.Serializer(request); RpcEnvelope envelope = new RpcEnvelope(); envelope.ServiceName = method.ServiceName; envelope.MethodName = method.Name; envelope.Payload = Google.Protobuf.ByteString.CopyFrom(msg); envelope.RequestId = GetNewRequestId(); PendingRequest <TRequest, TResponse> pending = new PendingRequest <TRequest, TResponse>(envelope.RequestId, method); AddPendingRequest(pending); m_Channel.Send((IMessage)envelope); return(pending.WaitReponse()); }
public abstract void PacketReceived(RpcEnvelope envelope);