Exemple #1
0
        //同步方法
        public Void Quit(Void request)
        {
            AmpMessage message = AmpMessage.CreateRequestMessage(50000, 10000);

            message.Data = request.ToByteArray();
            var response = base.CallInvoker.BlockingCall(message);

            if (response != null && response.Data != null)
            {
                return(Void.Parser.ParseFrom(response.Data));
            }
            throw new RpcException("请求出错,请检查!");
        }
Exemple #2
0
        public async Task <Void> QuitAsync(Void request, int timeOut = 3000)
        {
            AmpMessage message = AmpMessage.CreateRequestMessage(50000, 10000);

            message.Data = request.ToByteArray();
            var response = await base.CallInvoker.AsyncCall(message, timeOut);

            if (response != null && response.Data != null)
            {
                return(Void.Parser.ParseFrom(response.Data));
            }
            throw new RpcException("请求出错,请检查!");
        }