コード例 #1
0
		/// <summary>Default Logger</summary>
		//private static ILog log = LogManager.GetLogger( typeof( SMTPContext ) );
		
		/// <summary>Logs all IO.  Seperate from normal Logger.</summary>
		//private static ILog ioLog = LogManager.GetLogger( "IO." + typeof( SMTPContext ) );
				
		#endregion
		
		#region Constructors
		
		/// <summary>
		/// Initialize this context for a given socket connection.
		/// </summary>
		public SMTPContext( long connectionId, Socket socket )
		{
			//if( log.IsDebugEnabled ) log.Debug( String.Format( "Connection {0}: New connection from client {1}", connectionId, socket.RemoteEndPoint ) );
			
			this.connectionId = connectionId;
			this.lastCommand = -1;
			this.socket = socket;
			message = new SMTPMessage();
			
			// Set the encoding to ASCII.  
			encoding = Encoding.ASCII;
			
			// Initialize the input buffer
			inputBuffer = new StringBuilder();
		}
コード例 #2
0
 public MessageEventArgs(SMTPMessage message)
 {
     this.Message = message;
 }
コード例 #3
0
		/// <summary>
		/// Resets this context for a new message
		/// </summary>
		public void Reset()
		{
			//if( log.IsDebugEnabled ) log.Debug( String.Format( "Connection {0}: Reset" , connectionId ) );
			message = new SMTPMessage();
			lastCommand = SMTPProcessor.COMMAND_HELO;
		}
コード例 #4
0
		/// <summary>
		/// Addes the message to the in memory queue.
		/// </summary>
		/// <param name='message'>The message to queue.</param>
		public virtual bool SpoolMessage(SMTPMessage message)
		{
			queue.Enqueue( message );
			return true;
		}