Пример #1
0
        public RelayTunnel Create(HybridConnectionStream stream, ILocalDataChannelFactory localFactory)
        {
            var tunnel = new RelayTunnel(_log, _metrics, stream, localFactory, OnTunnelCompleted);

            _tunnels[tunnel] = tunnel;

            return(tunnel);
        }
Пример #2
0
        private Task OnTunnelCompleted(RelayTunnel tunnel)
        {
            if (_tunnels.TryRemove(tunnel, out _))
            {
                tunnel.IgnoreException(x => x.Dispose());
            }

            return(Task.CompletedTask);
        }