Skip to content

Commit

Permalink
Issue jetty#5794 ensuring serverChannel is closed in the event of a f…
Browse files Browse the repository at this point in the history
…ailed bind to ensure proper resources are cleaned

Signed-off-by: Joe Witt <joewitt@apache.org>
  • Loading branch information
joewitt committed Dec 11, 2020
1 parent 639cad6 commit f7d4b94
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -346,6 +346,14 @@ protected ServerSocketChannel openAcceptChannel() throws IOException
}
catch (BindException e)
{
try
{
serverChannel.close();
}
catch (IOException ioe)
{
LOG.warn(ioe);
}
throw new IOException("Failed to bind to " + bindAddress, e);
}
}
Expand Down

0 comments on commit f7d4b94

Please sign in to comment.