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

@ -306,6 +306,7 @@ class SinkChannelImpl
writeLock.lock();
try {
ensureOpen();
boolean blocking = isBlocking();
int n = 0;
try {
@ -334,6 +335,7 @@ class SinkChannelImpl
writeLock.lock();
try {
ensureOpen();
boolean blocking = isBlocking();
long n = 0;
try {

View file

@ -306,6 +306,7 @@ class SourceChannelImpl
readLock.lock();
try {
ensureOpen();
boolean blocking = isBlocking();
int n = 0;
try {
@ -334,6 +335,7 @@ class SourceChannelImpl
readLock.lock();
try {
ensureOpen();
boolean blocking = isBlocking();
long n = 0;
try {