示例#1
0
 /// <summary>
 /// 拿到程序服务配置信息
 /// </summary>
 /// <param name="ConfigKey"></param>
 /// <returns></returns>
 public async static Task <ProtoProxy.ServerAddressReply> GetServerAddress(string ServerName)
 {
     return(await Task.Run(() =>
     {
         Channel channel = CreateChannel();
         var client = new ConfigDc.ProtoProxy.ConfigDcUtil.ConfigDcUtilClient(channel);
         var serverRes = client.GetServerAddress(new ProtoProxy.ServerAddressRequest()
         {
             ServerName = ServerName
         });
         channel.ShutdownAsync();   //关闭长连接
         return serverRes;
     }));
 }