예제 #1
0
 /// <summary>
 /// 创建一个适用于主动方的SAI Connection。
 /// </summary>
 protected SaiConnection(RsspEndPoint rsspEP, IEnumerable <RsspTcpLinkConfig> linkConfig,
                         ISaiConnectionObserver observer,
                         IAleTunnelEventNotifier tunnelEventNotifier)
     : this(rsspEP, observer)
 {
     _maslConnection = new MaslConnectionClient(rsspEP, linkConfig, this, tunnelEventNotifier);
 }
예제 #2
0
 /// <summary>
 /// 创建一个适用于被动方的SAI Connection。
 /// </summary>
 protected SaiConnection(RsspEndPoint rsspEP,
                         ISaiConnectionObserver observer,
                         IAleTunnelEventNotifier tunnelEventNotifier)
     : this(rsspEP, observer)
 {
     _maslConnection = new MaslConnectionServer(rsspEP, this, tunnelEventNotifier);
 }
예제 #3
0
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _disposed = true;

                this.Connected = false;

                if (disposing)
                {
                    if (_handshakeTimeoutMgr != null)
                    {
                        _handshakeTimeoutMgr.Dispose();
                        _handshakeTimeoutMgr = null;
                    }

                    if (_maslConnection != null)
                    {
                        _maslConnection.Dispose();
                        _maslConnection = null;
                    }

                    if (_defenseStrategy != null)
                    {
                        _defenseStrategy.Dispose();
                        _defenseStrategy = null;
                    }
                }
            }
        }