internal Channel(IExchange exchange, IExchangePool exchanges, TimeSpan timeout, Action <object> cancellationCallback, CorrelationId id) { this.exchange = exchange; timeoutTokenSource = new CancellationTokenSource(timeout); cancellation = timeoutTokenSource.Token.Register(cancellationCallback, id); exchangeOwner = exchanges; }
internal UdpServer(IPEndPoint address, int backlog, MemoryAllocator <byte> allocator, Func <int, IExchangePool> exchangePoolFactory, ILoggerFactory loggerFactory) : base(address, backlog, allocator, loggerFactory) { channels = new INetworkTransport.ChannelPool <Channel>(backlog); cancellationHandler = channels.CancellationRequested; exchanges = exchangePoolFactory(backlog); }