private TcpConnectionConnector(IBandwidthLimiter senderBandwidthLimiter, IBandwidthLimiter receiverBandwidthLimiter, ISocks5ProxyClientFactory socks5ProxyClientFactory, IHttpProxyClientFactory httpProxyClientFactory, IBatchActionDispatcher batchActionDispatcher, IBytesPool bytesPool, TcpConnectionConnectorOptions options)
 {
     _senderBandwidthLimiter   = senderBandwidthLimiter;
     _receiverBandwidthLimiter = receiverBandwidthLimiter;
     _socks5ProxyClientFactory = socks5ProxyClientFactory;
     _httpProxyClientFactory   = httpProxyClientFactory;
     _batchActionDispatcher    = batchActionDispatcher;
     _bytesPool = bytesPool;
     _options   = options;
 }
Beispiel #2
0
        public SessionStatus(ISession session, ExchangeType exchangeType, OmniHash rootHash, IBatchActionDispatcher batchActionDispatcher)
        {
            this.Session               = session;
            this.ExchangeType          = exchangeType;
            this.RootHash              = rootHash;
            this.BatchActionDispatcher = batchActionDispatcher;
            this.LastReceivedTime      = DateTime.UtcNow;

            this.SentBlockHashes         = new(TimeSpan.FromMinutes(3), TimeSpan.FromSeconds(30), batchActionDispatcher);
            this.ReceivedWantBlockHashes = new(TimeSpan.FromMinutes(3), TimeSpan.FromSeconds(30), batchActionDispatcher);
        }
    public static OmniConnectionMultiplexer CreateV1(IConnection connection, IBatchActionDispatcher batchActionDispatcher, IBytesPool bytesPool, V1.OmniConnectionMultiplexerOptions options)
    {
        var multiplexer = new V1.Internal.ConnectionMultiplexer(connection, batchActionDispatcher, bytesPool, options);

        return(new OmniConnectionMultiplexer(connection, multiplexer));
    }
    public static async ValueTask <TcpConnectionConnector> CreateAsync(IBandwidthLimiter senderBandwidthLimiter, IBandwidthLimiter receiverBandwidthLimiter, ISocks5ProxyClientFactory socks5ProxyClientFactory, IHttpProxyClientFactory httpProxyClientFactory, IBatchActionDispatcher batchActionDispatcher, IBytesPool bytesPool, TcpConnectionConnectorOptions options, CancellationToken cancellationToken = default)
    {
        var tcpConnectionConnector = new TcpConnectionConnector(senderBandwidthLimiter, receiverBandwidthLimiter, socks5ProxyClientFactory, httpProxyClientFactory, batchActionDispatcher, bytesPool, options);

        return(tcpConnectionConnector);
    }
Beispiel #5
0
        public SessionStatus(ISession session, ReadOnlyMemory <byte> id, NodeLocation nodeLocation, IBatchActionDispatcher batchActionDispatcher)
        {
            this.Session          = session;
            this.Id               = id;
            this.NodeLocation     = nodeLocation;
            this.LastReceivedTime = DateTime.UtcNow;

            this.ReceivedWantContentClues = new VolatileHashSet <ContentClue>(TimeSpan.FromMinutes(3), TimeSpan.FromSeconds(30), batchActionDispatcher);
        }