/// <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); }
/// <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()) }; }
/// <summary> /// Constructor. /// </summary> /// <param name="context">The session context.</param> internal SmtpSession(SmtpSessionContext context) { _context = context; _stateMachine = new SmtpStateMachine(_context); }
/// <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()); }