Exemplo n.º 1
0
        void disposeInternal(bool disposeBrother)
        {
            if (!mDisposed)
            {
                try
                {
                    mInnerChannel.Close();
                }
                catch (Exception ex)
                {
                    Debug.Fail($"InnerChannel close catch an exception: {ex.ToString()}");
                }

                if (mBrotherTunnel != null && disposeBrother)
                {
                    mBrotherTunnel.disposeInternal(false);
                }

                mInnerChannel  = null;
                mSelector      = null;
                mBrotherTunnel = null;
                mDisposed      = true;
                sessionCount--;

                onDispose();
                NatSessionManager.removeSession(portKey);
            }
        }
Exemplo n.º 2
0
 public void setBrotherTunnel(TcpTunnel brotherTunnel)
 {
     mBrotherTunnel = brotherTunnel;
 }