Пример #1
0
        /// <summary>
        /// Erzeugen des Datenkanals.
        /// </summary>
        /// <param name="result">Aktuelle Informationen zum zugehörigen Steuerkanal.</param>
        private void OnAcceptPassive(IAsyncResult result)
        {
            // Report
            FTPMain.Log("OnAcceptPassive");

            // We are terminating
            if (null == m_Passive)
            {
                return;
            }

            // What to do
            Processor processor;

            // Synchronize
            lock (m_DataLock)
            {
                // Get the communication socket
                m_Data = new DataChannel(m_Passive.EndAccept(result), OnDataChannelFinished);

                // Load processor
                processor = m_DelayedProcessor;

                // Reset
                m_DelayedProcessor = null;
            }

            // Nothing to do
            if (null != processor)
            {
                processor(m_DelayedCommand);
            }
        }
Пример #2
0
        /// <summary>
        /// Schließt den Datenkanal.
        /// </summary>
        private void CloseData()
        {
            // Report
            FTPMain.Log("CloseData");

            // Reset
            m_DelayedProcessor = null;

            // Start cleanup data channel
            lock (m_DataLock)
                using (DataChannel cleanup = m_Data)
                    m_Data = null;
        }
Пример #3
0
        /// <summary>
        /// Wird vom Datenkanal <see cref="DataChannel"/> aufgerufen, sobald alle Daten übertragen wurden.
        /// </summary>
        /// <param name="data">Der abgeschlossene Datenkanal.</param>
        private void OnDataChannelFinished(DataChannel data)
        {
            // Report
            Send(226, "Transfer Complete");

            // Terminate on empty file
            if (!data.GotData)
            {
                // Report
                FTPMain.Log("Detected empty File");

                // Remember
                m_EmptyFile = true;

                // Terminate
                Close();
            }
        }
Пример #4
0
		/// <summary>
		/// Schließt den Datenkanal.
		/// </summary>
		private void CloseData()
		{
            // Report
            FTPMain.Log("CloseData");
            
            // Reset
			m_DelayedProcessor = null;

			// Start cleanup data channel
			lock (m_DataLock)
				using (DataChannel cleanup = m_Data)
					m_Data = null;
		}
Пример #5
0
		/// <summary>
		/// Wird vom Datenkanal <see cref="DataChannel"/> aufgerufen, sobald alle Daten übertragen wurden.
		/// </summary>
		/// <param name="data">Der abgeschlossene Datenkanal.</param>
		private void OnDataChannelFinished(DataChannel data)
		{
            // Report
			Send(226, "Transfer Complete");

			// Terminate on empty file
			if (!data.GotData)
			{
                // Report
                FTPMain.Log("Detected empty File");

				// Remember
				m_EmptyFile = true;

				// Terminate
				Close();
			}
		}
Пример #6
0
		/// <summary>
		/// Erzeugen des Datenkanals.
		/// </summary>
		/// <param name="result">Aktuelle Informationen zum zugehörigen Steuerkanal.</param>
		private void OnAcceptPassive(IAsyncResult result)
		{
            // Report
            FTPMain.Log("OnAcceptPassive");
            
            // We are terminating
			if (null == m_Passive) return;

			// What to do
			Processor processor;

			// Synchronize
			lock (m_DataLock)
			{
				// Get the communication socket
				m_Data = new DataChannel(m_Passive.EndAccept(result), OnDataChannelFinished);

				// Load processor
				processor = m_DelayedProcessor;

				// Reset
				m_DelayedProcessor = null;
			}

			// Nothing to do
			if (null != processor) processor(m_DelayedCommand);
		}