コード例 #1
0
 private void AddTunnel(Tunnel tunnel)
 {
     lock ( RunningTunnels )
     {
         RunningTunnels.Add(tunnel);
     }
 }
コード例 #2
0
        void RemovePoolTunnel(Tunnel tunnel)
        {
            if (tunnel is OutboundTunnel)
            {
                lock ( OutboundEstablishedPool )
                {
again:
                    var match = OutboundEstablishedPool.IndexOf((OutboundTunnel)tunnel);
                    if (match != -1)
                    {
                        OutboundEstablishedPool.RemoveAt(match);
                        goto again;
                    }
                }
            }

            if (tunnel is InboundTunnel)
            {
                lock ( InboundEstablishedPool )
                {
again:
                    var match = InboundEstablishedPool.IndexOf((InboundTunnel)tunnel);
                    if (match != -1)
                    {
                        InboundEstablishedPool.RemoveAt(match);
                        goto again;
                    }
                }
                RemoveTunnelFromLeaseSet((InboundTunnel)tunnel);
            }
        }
コード例 #3
0
        void RemovePendingTunnel(Tunnel tunnel)
        {
            if (tunnel is OutboundTunnel)
            {
                lock ( OutboundPending )
                {
                    var match = OutboundPending.IndexOf((OutboundTunnel)tunnel);
                    if (match != -1)
                    {
                        OutboundPending.RemoveAt(match);
                    }
                }
            }

            if (tunnel is InboundTunnel)
            {
                lock ( InboundPending )
                {
                    var match = InboundPending.IndexOf((InboundTunnel)tunnel);
                    if (match != -1)
                    {
                        InboundPending.RemoveAt(match);
                    }
                }
            }
        }
コード例 #4
0
        private void RemoveTunnel(Tunnel tunnel)
        {
            lock ( RunningTunnels )
            {
again:
                var match = RunningTunnels.IndexOf(tunnel);
                if (match != -1)
                {
                    RunningTunnels.RemoveAt(match);
                    goto again;
                }
            }
        }
コード例 #5
0
        internal void TunnelEstablished(Tunnel tunnel)
        {
            RemovePendingTunnel(tunnel);

            if (tunnel is OutboundTunnel)
            {
                lock (OutboundEstablishedPool) OutboundEstablishedPool.Add((OutboundTunnel)tunnel);
            }

            if (tunnel is InboundTunnel)
            {
                var it = (InboundTunnel)tunnel;

                lock (InboundEstablishedPool) InboundEstablishedPool.Add(it);
                it.GarlicMessageReceived += new Action <I2PCore.Tunnel.I2NP.Messages.GarlicMessage>(InboundTunnel_GarlicMessageReceived);
                AddTunnelToLeaseSet(it);
            }
        }
コード例 #6
0
 internal TestRun2(Tunnel testtunnel)
 {
     TunnelUnderTest = testtunnel;
 }
コード例 #7
0
 internal TunnelTestResult(Tunnel tunnel)
 {
     TestedTunnel = tunnel;
 }
コード例 #8
0
 internal void TunnelTimeout(Tunnel tunnel)
 {
 }
コード例 #9
0
 internal void TunnelBuildTimeout(Tunnel tunnel)
 {
 }
コード例 #10
0
 internal void TunnelEstablished(Tunnel tunnel)
 {
 }
コード例 #11
0
 internal void TunnelTimeout(Tunnel tunnel)
 {
     Logging.LogDebug("PassthroughProvider: TunnelTimeout: " + tunnel.ToString());
     RemoveTunnel(tunnel);
 }
コード例 #12
0
 internal void TunnelBuildTimeout(Tunnel tunnel)
 {
     // Never called, I think
 }
コード例 #13
0
 internal void TunnelEstablished(Tunnel tunnel)
 {
     // Never called, I think
 }
コード例 #14
0
 internal void RemoveTunnel(Tunnel tunnel)
 {
     RemovePendingTunnel(tunnel);
     RemovePoolTunnel(tunnel);
 }