示例#1
0
        static void RunConsole(MonoTorrentClient monoTorrent, ServiceWebUI webUI)
        {
            InitTrace();

            Trace.WriteLine("Starting MonoTorrent engine...");
            monoTorrent.DebugStart();
            Trace.WriteLine("MonoTorrent engine started.");

            Trace.WriteLine("Starting WebUI...");
            webUI.DebugStart();
            Trace.WriteLine("WebUI running on " + webUI.ListeningAddress + ".");

            Console.WriteLine("(Press ESC to halt)");
            while (Console.ReadKey().Key != ConsoleKey.Escape) { }

            Trace.WriteLine("Stopping WebUI...");
            webUI.DebugStop();
            Trace.WriteLine("WebUI stopped.");

            Trace.WriteLine("Stopping MonoTorrent engine...");
            monoTorrent.DebugStop();
            Trace.WriteLine("MonoTorrent engine stopped.");

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
示例#2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            MonoTorrentClient monoTorrent = new MonoTorrentClient();
            ServiceWebUI webUI = new ServiceWebUI(monoTorrent);

            //ServiceBase[] servicesToRun = new ServiceBase[] { monoTorrent, webUI };
            //ServiceBase.Run(servicesToRun);

            RunConsole(monoTorrent, webUI);
        }
示例#3
0
文件: Program.cs 项目: kl4w/BTDeploy
        protected static void RunServiceDaemon(IEnvironmentDetails environmentDetails)
        {
            // Make the torrent client.
            var monotTorrentClient = new MonoTorrentClient(environmentDetails.ApplicationDataDirectoryPath);

            monotTorrentClient.Start();

            // Make torrent service app host.
            var servicesAppHost = new ServicesAppHost(environmentDetails, monotTorrentClient);

            servicesAppHost.Init();

            // Never die.
            Thread.Sleep(Timeout.Infinite);
        }