Example #1
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="clientSocket">Referance to socket.</param>
        /// <param name="server">Referance to FTP server.</param>
        /// <param name="sessionID">Session ID which is assigned to this session.</param>
        /// <param name="logWriter">Log writer.</param>
        public FTP_Session(Socket clientSocket, FTP_Server server, string sessionID, SocketLogger logWriter)
        {
            m_pSocket   = new BufferedSocket(clientSocket);
            m_pServer   = server;
            m_SessionID = sessionID;
            //		m_pLogWriter       = logWriter;
            m_SessionStartTime = DateTime.Now;
            m_LastDataTime     = DateTime.Now;

            m_pSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, 1);
            m_pSocket.Activity += new EventHandler(OnSocketActivity);

            // Start session proccessing
            StartSession();
        }
		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="clientSocket">Referance to socket.</param>
		/// <param name="server">Referance to FTP server.</param>
		/// <param name="sessionID">Session ID which is assigned to this session.</param>
		/// <param name="logWriter">Log writer.</param>
		public FTP_Session(Socket clientSocket,FTP_Server server,string sessionID,SocketLogger logWriter)
		{
			m_pSocket    = new BufferedSocket(clientSocket);
			m_pServer          = server;
			m_SessionID        = sessionID;
	//		m_pLogWriter       = logWriter;
			m_SessionStartTime = DateTime.Now;
			m_LastDataTime     = DateTime.Now;

			m_pSocket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.NoDelay,1);
			m_pSocket.Activity += new EventHandler(OnSocketActivity);

			// Start session proccessing
			StartSession();
		}