public void Stop()
{
this.log.Debug("Trying to stop SmtpServer.");
try
{
lock (this)
{
this.stop = true;
// Kick the server accept loop
if (this.tcpListener != null)
{
// _processor.Stop();
this.log.Debug("Stopping tcp listener.");
this.tcpListener.Stop();
this.log.Debug("Tcp listener stopped.");
}
this.tcpListener = null;
}
}
catch (Exception ex)
{
this.log.Warn("Unexpected Exception stopping SmtpServer", ex);
}
finally
{
this.log.Debug("SmtpServer Stopped.");
this.ServerReady.Close();
}
}