Exemplo n.º 1
0
        public static DqliteNode Create(ulong id, string address, string dataDir, DqliteNodeOptions options = null)
        {
            CheckError(dqlite_node_create(id, address, dataDir, out var node), node);
            CheckError(dqlite_node_set_bind_address(node, options?.Address ?? address), node);

            if (options?.DialFunction != null)
            {
                CheckError(dqlite_node_set_connect_func(node, options.DialFunction, IntPtr.Zero), node);
            }

            if (options?.NetworkLatency != null)
            {
                CheckError(dqlite_node_set_network_latency(node, (ulong)options.NetworkLatency.TotalMilliseconds * 1000000UL), node);
            }

            return(new DqliteNode(node, id, address));
        }
Exemplo n.º 2
0
        public static DqliteNode Create(string address, string dataDir, DqliteNodeOptions options = null)
        {
            var id = dqlite_generate_node_id(address);

            return(Create(id, address, dataDir, options));
        }
Exemplo n.º 3
0
 public DqliteOptions()
 {
     this.NodeOptions = new DqliteNodeOptions();
 }
 public DQliteOptions()
 {
     this.ConnectionOptions = new DqliteConnectionStringBuilder();
     this.NodeOptions       = new DqliteNodeOptions();
 }