static void Main(string[] args) { DotnettyServer httpServer = DotnettyServer.InitializeCreate("127.0.0.1", 2379) .RunServer(5003); //Console.WriteLine($"Httpd started. Listening on {httpServer.BootstrapChannel.LocalAddress}"); Console.ReadLine(); }
/// <summary> /// 初始化当前对象 /// </summary> /// <returns></returns> public static DotnettyServer InitializeCreate(string etcdHost, int etcdPort) { if (httpServer == null) { lock (_readoLook) { if (httpServer == null) { httpServer = new DotnettyServer(etcdHost, etcdPort); } } } return(httpServer); }