private static ReadOnlySequence <byte> AllBytes(TestSocket fakeProxiedSocket)
 => fakeProxiedSocket.BytesSent;
 public TestListenerForPeer(TestSocket testSocket, INodeSink nodeSink, IExternalAccessDiscoverer discoverer, CancellationTokenSource source, ILogger logger) : base(nodeSink, discoverer, source, logger)
     => _testSocket = new SingleUseSocket(testSocket, _source);
Ejemplo n.º 3
0
        private static TestConnection Setup(int inactivityTimeoutInMinutes, out FakeLogging fakeLogger, out TestSocket fakeSocket, out TestSink fakeSink)
        {
            fakeLogger = new FakeLogging();
            var source = new CancellationTokenSource();

            fakeSocket = new TestSocket(13, 1, 128, 2);
            fakeSink   = new TestSink(13, 1, 129);
            var fakeConfig = new FakeConfig(13, "UnitTest", "unit", 4096, inactivityTimeoutInMinutes, 4);

            return(new TestConnection(fakeSocket, fakeSink, "TestConnection", fakeConfig, source, fakeLogger, null));
        }
 public TestListenerForProxying(TestSocket overridingSocket, string externalAddress, string hostedAddress, ushort firstPort, ConnectionInitiatedByPeer connection, SocketFactory socketFactory, CancellationTokenSource source, ILogger logger) :
     base(externalAddress, hostedAddress, firstPort, connection, socketFactory, source, logger)
     => _testSocket = new SingleUseSocket(overridingSocket, _source);