コード例 #1
0
        public NegotiatorFixture()
        {
            pipeline = new LeakPipeline();
            pipeline.Start();

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

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

            pool.Start();

            hooks      = new HandshakeNegotiatorHooks();
            negotiator =
                new HandshakeNegotiatorBuilder()
                .WithNetwork(pool)
                .Build(hooks);
        }
コード例 #2
0
 public static void Handle(this HandshakeNegotiator negotiator, NetworkConnection connection, FileHash hash)
 {
     negotiator.Handle(connection, new HandshakeNegotiatorPassiveInstance(PeerHash.Random(), hash, HandshakeOptions.Extended));
 }