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); }
public static void Handle(this HandshakeNegotiator negotiator, NetworkConnection connection, FileHash hash) { negotiator.Handle(connection, new HandshakeNegotiatorPassiveInstance(PeerHash.Random(), hash, HandshakeOptions.Extended)); }