Esempio n. 1
0
        static void Main(string[] args)
        {
            //初始化配置
            var    setting = new Setting();
            Logger logger  = new Logger();

            //初始化db
            new StorageService(setting);

            //开始恢复数据
            var rt = new RestoreTrack(setting);

            rt.Start();

            //开启服务
            ISystem systemL = PipelineSystem.CreatePipelineSystemV1(logger);

            systemL.OpenNetwork(new PeerOption());
            systemL.OpenListen(new IPEndPoint(IPAddress.Parse(setting.BindAddress), setting.Port));
            systemL.RegistModule("server", new ServerModule());


            systemL.Start();
            Console.ReadKey();
        }
Esempio n. 2
0
        public static SimpleServerDB Open(Setting setting)
        {
            var logger  = new Logger();
            var systemC = PipelineSystem.CreatePipelineSystemV1(logger);
            var db      = new SimpleServerDB(setting);

            systemC.RegistModule("client", db);
            systemC.OpenNetwork(new PeerOption());
            systemC.Start();
            db.actor = systemC.GetPipeline(null, "this/client");
            return(db);
        }