<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="moz-cite-prefix">On 23/10/2025 23:09, David Alayachew
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAA9v-_Mem7TqqhNa6SKQPZrAOjKvzuhBka6G4U5LTNditE0nJg@mail.gmail.com">
<div dir="auto">Hello <span class="gmail_chip gmail_plusreply" dir="auto"><a href="mailto:core-libs-dev@openjdk.org" style="color:#15c;text-decoration:underline" moz-do-not-send="true">@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>
</body>
</html>