コード例 #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);
            }
        }
コード例 #2
0
 public void setBrotherTunnel(TcpTunnel brotherTunnel)
 {
     mBrotherTunnel = brotherTunnel;
 }