public Task StartAsync(CancellationToken cancellationToken) { _channel = GrpcChannel.ForAddress("https://localhost:8787", new GrpcChannelOptions() { HttpClient = CreateHttpClient() }); _client = new SpringGrpcService.SpringGrpcServiceClient(_channel); SetUpTimer(); return(Task.CompletedTask); }
public Task StartAsync(CancellationToken cancellationToken) { channel = new Channel("127.0.0.1:8787", ChannelCredentials.Insecure); client = new SpringGrpcService.SpringGrpcServiceClient(channel); timer = new System.Timers.Timer(); timer.Elapsed += new ElapsedEventHandler(SendMessage); timer.Interval = 3500; // number in miliseconds timer.Enabled = true; return(Task.CompletedTask); }
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); }
public ClientScheduledService() { channel = new Channel("127.0.0.1:8787", ChannelCredentials.Insecure); client = new Protos.SpringGrpcService.SpringGrpcServiceClient(channel); }