Beispiel #1
0
        private void PacketReceived(RpcEnvelope envelope)
        {
            PendingRequest pending;

            if (m_RequestsPending.TryGetValue(envelope.RequestId, out pending))
            {
                pending.PacketReceived(envelope);
            }
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
 public abstract void PacketReceived(RpcEnvelope envelope);