Summary
Correct the specification of SelectionKey.OP_READ
and SelectionKey.OP_WRITE
.
Problem
The specification incorrectly states that OP_READ
, OP_WRITE
, respectively, will be added to the key's ready-operation set when the corresponding channel has been remotely shut down for further reading, writing, respectively, when it should be the converse.
Solution
Change the specification to state that OP_READ
, OP_WRITE
, respectively, will be added to the key's ready-operation set when the corresponding channel has been remotely shut down for further writing, reading, respectively.
Specification
Please see also the attached webrev.
OP_READ
Operation-set bit for read operations.
Suppose that a selection key's interest set contains OP_READ at the start of a selection operation. If the selector detects that the corresponding channel is ready for reading, has reached end-of-stream, has been remotely shut down for further writing, or has an error pending, then it will add OP_READ to the key's ready-operation set.
OP_WRITE
Operation-set bit for write operations.
Suppose that a selection key's interest set contains OP_WRITE at the start of a selection operation. If the selector detects that the corresponding channel is ready for writing, has been remotely shut down for further reading, or has an error pending, then it will add OP_WRITE to the key's ready set.
- csr of
-
JDK-4617266 (se spec) SelectionKey.OP_READ/OP_WRITE documentation errors
- Resolved