private void ShuntDownChannel(Grpc.Core.ChannelBase managedChannel) { if (managedChannel != null) { managedChannel.ShutdownAsync().GetAwaiter().GetResult(); } }
private CommonResponse ServerCheck(Grpc.Core.ChannelBase channel) { try { var payload = GrpcUtils.Convert <object>(new { }, new RequestMeta { Type = RemoteRequestType.Req_ServerCheck }); var client = new Nacos.Request.RequestClient(channel); var resp = client.request(payload); var res = GrpcUtils.Parse(resp); return((CommonResponse)res); } catch (Exception ex) { logger?.LogError(ex, "[{0}]Fail to server check!", GetName()); return(null); } }
public void SetChannel(Grpc.Core.ChannelBase channel) => this.channel = channel;