<div dir="ltr"><div class="gmail_default" style="font-family:monospace">Thanks Alan, I'll reattempt this thread over there.</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Oct 24, 2025 at 1:57 AM Alan Bateman <<a href="mailto:alan.bateman@oracle.com">alan.bateman@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
  <div>
    <div>On 23/10/2025 23:09, David Alayachew
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="auto">Hello <span class="gmail_chip gmail_plusreply" dir="auto"><a href="mailto:core-libs-dev@openjdk.org" style="color:rgb(17,85,204);text-decoration:underline" target="_blank">@core-libs-dev</a></span>,
        <div dir="auto"><br>
        </div>
        <div dir="auto">Would it be ok if we made HttpServer from the
          jdk.httpserver module implement AutoCloseable? Having this
          would prevent people from forgetting to close the server after
          use.</div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">The close() implementation could call stop(int
          delay) with a reasonable default. This implementation should
          be a default one, so that existing child classes that also
          implemented AutoCloseable lose no functionality.</div>
        <br>
      </div>
    </blockquote>
    The net-dev mailing list is where networking and HTTP issues are
    usually discussed. HttpExchange was retrofitted to implement
    AutoCloseable in JDK 14 and there may have been discussed (can't
    remember) about HttpServer at the time.<br>
    <br>
    -Alan<br>
  </div>

</blockquote></div>