Beispiel #1
0
        public async void SendUrgentMessage(string name, string quantity)

        {
            try
            {
                MessagePharmacyResponse response = await client.communicateAsync(new MessagePharmacy()
                {
                    Name = name, Quantity = quantity
                });

                GrpcMessage message = new GrpcMessage(response.Name, response.Status);
                MessageForUrgentProcurement.Add(message);
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.StackTrace);
            }
        }
Beispiel #2
0
        public async Task <string> SendMessage(string name)
        {
            client = new SpringGrpcService.SpringGrpcServiceClient(new Channel("127.0.0.1:8787", ChannelCredentials.Insecure));

            MessageResponseProto response = await client.communicateAsync(new MessageProto()
            {
                Message = name
            });

            return(response.Response);
        }
        private async void SendMessage(object source, ElapsedEventArgs e)
        {
            try
            {
                MessageResponseProto response = await _client.communicateAsync(new MessageProto()
                {
                    Message = "Random message from asp.net client: " + Guid.NewGuid().ToString(), RandomInteger = new Random().Next(1, 101)
                });

                Console.WriteLine(response.Response + " is response; status: " + response.Status);
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.StackTrace);
            }
        }