Esempio n. 1
0
        public ListenerFixture()
        {
            pipeline = new LeakPipeline();
            pipeline.Start();

            worker = new CompletionThread();
            worker.Start();

            pool =
                new NetworkPoolBuilder()
                .WithPipeline(pipeline)
                .WithWorker(worker)
                .WithMemory(new ListenerMemory())
                .Build();

            pool.Start();

            hooks = new PeerListenerHooks();
        }
Esempio n. 2
0
        private void StartListener()
        {
            if (Settings.Listener)
            {
                PeerListenerHooks hooks = new PeerListenerHooks
                {
                    OnConnectionArrived = OnConnectionArrived,
                    OnListenerStarted   = OnListenerStarted,
                    OnListenerFailed    = OnListenerFailed
                };

                Listener =
                    new PeerListenerBuilder()
                    .WithNetwork(Network)
                    .WithPort(Settings)
                    .Build(hooks);

                Listener.Start();
            }
        }