Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        public Client Init()
        {
            try
            {
                var httpClientHandler = new HttpClientHandler();
                httpClientHandler.ServerCertificateCustomValidationCallback =
                    HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
                var httpClient = new HttpClient(httpClientHandler);

                grpcChannel = Grpc.Net.Client.GrpcChannel.ForAddress(@"https://" + Ip + ":" + Port, new GrpcChannelOptions {
                    HttpClient = httpClient
                });

                mRealDataClient = new RealData.RealDataClient(grpcChannel);

                mHisDataClient = new HislData.HislDataClient(grpcChannel);

                mSecurityClient = new Security.SecurityClient(grpcChannel);
            }
            catch (Exception ex)
            {
                LoggerService.Service.Erro("DevelopService", ex.Message);
            }
            return(this);
        }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 public void Dispose()
 {
     mLoginId        = string.Empty;
     mHisDataClient  = null;
     mRealDataClient = null;
     mSecurityClient = null;
     grpcChannel.Dispose();
 }