Esempio n. 1
0
 public Session(SimpleSocket socket, MailMessageHandler messageEvent, SenderAllowedHandler recipientEvent)
 {
     this.Socket = socket;
     this.MessageRecieved += messageEvent;
     this.RecipientFound += recipientEvent;
     Socket.SendString(SmtpCommandUtils.SV_GREET);
 }
Esempio n. 2
0
 private void Run()
 {
     while (Running)
     {
         if (listener.Pending())
         {
             var sSocket = new SimpleSocket(listener.AcceptSocket());
             SocketPool.Add(sSocket);
             ProcessSocket(sSocket);
             SocketPool.Remove(sSocket);
         }
         Thread.Sleep(50);
     }
 }
Esempio n. 3
0
        private void ProcessSocket(SimpleSocket s)
        {
            var session = new Session(s, new MailMessageHandler(OnMessageReceived), new SenderAllowedHandler(OnRecipientReceived));

            while (s.Connected && Running)
            {
                ProcessCommand(session.Socket.GetNextCommand(), session);
            }
        }