8329190: (ch) DatagramChannel.receive should throw ClosedChannelException when called on closed channel

Co-authored-by: Alan Bateman <alanb@openjdk.org>
Reviewed-by: jpai, michaelm
This commit is contained in:
Mark Sheppard 2024-04-16 15:44:15 +00:00
parent f11a496de6
commit 90df3b7fbb
6 changed files with 226 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -392,6 +392,7 @@ class ServerSocketChannelImpl
acceptLock.lock();
try {
ensureOpen();
boolean blocking = isBlocking();
try {
begin(blocking);