Ejemplo n.º 1
0
        public void SetClient(string SrvCfg, int SessionTimeout = -1)
        {
            if (client != null)
            {
                client.Dispose();
            }
            EtcdConfig config = Newtonsoft.Json.JsonConvert.DeserializeObject <EtcdConfig>(SrvCfg);

            client = new Kdetcd.Standard.EtcdDiscovery.Client(config.host, config.port,
                                                              config.username, config.password,
                                                              config.caCert, config.clientCert, config.clientKey,
                                                              config.publicRootCa);
        }
Ejemplo n.º 2
0
        public void SetServer(string Connstring, int SessionTimeout = -1)
        {
            EtcdConfig config = Newtonsoft.Json.JsonConvert.DeserializeObject <EtcdConfig>(Connstring);

            if (server != null)
            {
                server.Dispose();
            }
            server = new Kdetcd.Standard.EtcdDiscovery.Server(config.host, config.port,
                                                              SessionTimeout,
                                                              config.username, config.password,
                                                              config.caCert, config.clientCert, config.clientKey,
                                                              config.publicRootCa);
        }