File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
test/jdk/java/net/httpclient Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ private void createServers() throws IOException {
123123 public void afterClass () throws Exception {
124124 safeStop (originServer );
125125 safeStop (altServer );
126- udpNotResponding . close ( );
126+ safeClose ( udpNotResponding );
127127 }
128128
129129 private static void safeStop (final HttpTestServer server ) {
@@ -140,6 +140,19 @@ private static void safeStop(final HttpTestServer server) {
140140 }
141141 }
142142
143+ private static void safeClose (final DatagramChannel channel ) {
144+ if (channel == null ) {
145+ return ;
146+ }
147+ try {
148+ System .out .println ("Closing DatagramChannel " + channel .getLocalAddress ());
149+ channel .close ();
150+ } catch (Exception e ) {
151+ System .err .println ("Ignoring exception: " + e .getMessage () + " that occurred " +
152+ "during close of DatagramChannel: " + channel );
153+ }
154+ }
155+
143156 private static class H3AltServicePublisher implements HttpTestHandler {
144157 private static final String RESPONSE_CONTENT = "apple" ;
145158
You can’t perform that action at this time.
0 commit comments