示例#1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="options">The SMTP server options.</param>
 /// <param name="tcpClient">The TCP client to operate the session on.</param>
 internal SmtpSession(ISmtpServerOptions options, TcpClient tcpClient)
 {
     _options      = options;
     _tcpClient    = tcpClient;
     _context      = new SmtpSessionContext(tcpClient);
     _stateMachine = new SmtpStateMachine(options, _context);
 }
示例#2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="options">The SMTP server options.</param>
        /// <param name="tcpClient">The TCP client to operate the session on.</param>
        /// <param name="stateMachine">The SMTP state machine.</param>
        internal SmtpSession(ISmtpServerOptions options, TcpClient tcpClient, SmtpStateMachine stateMachine)
        {
            _options   = options;
            _tcpClient = tcpClient;

            Context = new SmtpSessionContext(new SmtpTransaction(), stateMachine, tcpClient.Client.RemoteEndPoint)
            {
                Text = new NetworkTextStream(tcpClient.GetStream())
            };
        }
示例#3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="context">The session context.</param>
 internal SmtpSession(SmtpSessionContext context)
 {
     _context      = context;
     _stateMachine = new SmtpStateMachine(_context);
 }
示例#4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="context">The session context.</param>
 internal SmtpSession(SmtpSessionContext context)
 {
     _context        = context;
     _stateMachine   = new SmtpStateMachine(_context);
     _commandFactory = context.ServiceProvider.GetServiceOrDefault <ISmtpCommandFactory>(new SmtpCommandFactory());
 }