Пример #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();
		}
Пример #2
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="clientSocket">Referance to socket.</param>
		/// <param name="server">Referance to IMAP server.</param>
		/// <param name="logWriter">Log writer.</param>
		internal IMAP_Session(Socket clientSocket,IMAP_Server server,SocketLogger logWriter)
		{
			m_pSocket = new BufferedSocket(clientSocket);
			m_pServer = server;

			m_SessionID        = Guid.NewGuid().ToString();			
			m_SessionStartTime = DateTime.Now;
			m_LastDataTime     = DateTime.Now;

			if(m_pServer.LogCommands){
				m_pSocket.Logger = logWriter;
				m_pSocket.Logger.SessionID = m_SessionID;
			}			

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

			// Start session proccessing
			StartSession();
		}
Пример #3
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="clientSocket">Referance to socket.</param>
		/// <param name="server">Referance to SMTP server.</param>
		/// <param name="logWriter">Log writer.</param>
		internal SMTP_Session(Socket clientSocket,SMTP_Server server,SocketLogger logWriter)
		{						
			m_pSocket    = new BufferedSocket(clientSocket);
			m_pServer    = server;
            
			m_pMsgStream   = new MemoryStream();
			m_SessionID    = Guid.NewGuid().ToString();
			m_BodyType     = BodyType.x7_bit;
			m_Forward_path = new Hashtable();
			m_CmdValidator = new SMTP_Cmd_Validator();
			m_SessionStart = DateTime.Now;
			m_LastDataTime = DateTime.Now;

			if(m_pServer.LogCommands){
				m_pSocket.Logger = logWriter;
				m_pSocket.Logger.SessionID = m_SessionID;
			}	

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

			// Start session proccessing
			StartSession();
		}