def stop(wait_seconds_before_close = 2, gracefully = true)
      # always signal shutdown
      shutdown if gracefully
      # wait if some connection(s) need(s) more time to handle shutdown
      sleep wait_seconds_before_close if connections?
      # drop tcp_servers while raising SmtpdStopServiceException
      @connections_mutex.synchronize do
        @tcp_server_threads.each do |tcp_server_thread|
          tcp_server_thread.raise SmtpdStopServiceException if tcp_server_thread
        end
      end
      # wait if some connection(s) still need(s) more time to come down
      sleep wait_seconds_before_close if connections? || !stopped?
    end
def stop(wait_seconds_before_close = 2, gracefully = true)
      # always signal shutdown
      shutdown if gracefully
      # wait if some connection(s) need(s) more time to handle shutdown
      sleep wait_seconds_before_close if connections?
      # drop tcp_servers while raising SmtpdStopServiceException
      @connections_mutex.synchronize do
        @tcp_server_threads.each do |tcp_server_thread|
          tcp_server_thread.raise SmtpdStopServiceException if tcp_server_thread
        end
      end
      # wait if some connection(s) still need(s) more time to come down
      sleep wait_seconds_before_close if connections? || !stopped?
    end
Stop the server