示例#1
0
        public void Start()
        {
            int logicalProcs = Environment.ProcessorCount;

            for (int i = 0; i < logicalProcs; i++)
            {
                string name = String.Format("T{0}", i + 1);
                _runtime.CreateThread(name);
            }

            Console.WriteLine("Created {0} runtime threads.", logicalProcs);

            var folderReader = new HttpActors.FolderReader();
            int readerId     = _runtime.AddActor(folderReader);

            var manager = new HttpActors.PumpManager();

            manager.MaxPumps     = MaxPumps;
            manager.Folder       = _folder;
            manager.FolderReader = readerId;

            int managerId = _runtime.AddActor(manager);

            Console.WriteLine("Starting web server at port {0} and folder '{1}'...", _port, _folder);
            _listener.Start();
            Console.WriteLine("Server started.");

            RunServer(_listener, managerId, _runtime, _source.Token);
        }
示例#2
0
        public void Start()
        {
            int logicalProcs = Environment.ProcessorCount;
            for (int i = 0; i < logicalProcs; i++)
            {
                string name = String.Format("T{0}", i + 1);
                _runtime.CreateThread(name);
            }

            Console.WriteLine("Created {0} runtime threads.", logicalProcs);

            var folderReader = new HttpActors.FolderReader();
            int readerId = _runtime.AddActor(folderReader);

            var manager = new HttpActors.PumpManager();
            manager.MaxPumps = MaxPumps;
            manager.Folder = _folder;
            manager.FolderReader = readerId;

            int managerId = _runtime.AddActor(manager);

            Console.WriteLine("Starting web server at port {0} and folder '{1}'...", _port, _folder);
            _listener.Start ();
            Console.WriteLine("Server started.");

            RunServer(_listener, managerId, _runtime, _source.Token);
        }