Inheritance: System.EventArgs
Exemplo n.º 1
0
		protected override void InvokeOnClientConnected(SessionEventArgs ea)
		{
			((VirtualFtpSession)ea.Session).CurrentFolder = fRootFolder;
			if (fUserManager == null) return;
			if (!fUserManager.CheckIP(ea.Connection.RemoteEndPoint, ea.Connection.LocalEndPoint))
			{
				ea.Connection.Disconnect();
				throw new Exception("Access not allowed from this IP.");
			}
			base.InvokeOnClientConnected(ea);
		}
Exemplo n.º 2
0
        protected internal override void InvokeOnClientDisconnected(SessionEventArgs e)
        {
            base.InvokeOnClientDisconnected(e);

            FtpSession lSession = (FtpSession)e.Session;
            if (lSession.ActiveConnection != null)
            {
                try
                {
                    lSession.ActiveConnection.Close();
                }
                catch
                {
                }
                lSession.ActiveConnection = null;
            }

            if (lSession.PassiveServer != null)
            {
                try
                {
                    lSession.PassiveServer.Close();
                }
                catch
                {
                }
                lSession.PassiveServer = null;
            }

            if (lSession.TransferThread != null)
            {
                try
                {
                    lSession.TransferThread.Abort();
                }
                catch
                {
                }
                lSession.TransferThread = null;
            }
        }
Exemplo n.º 3
0
 protected internal virtual void InvokeOnClientDisconnected(SessionEventArgs e)
 {
     if (this.OnClientDisconnected != null)
         this.OnClientDisconnected(this, e);
 }