8198372: API to create a SelectableChannel to a FileDescriptor

Alan Bateman Alan.Bateman at oracle.com
Thu Jun 21 17:32:52 UTC 2018

On 20/06/2018 20:57, Brian Burkhalter wrote:
> :
> Some more comments (which I initially had as comments on the CSR):
> 1: The phrasing "create a SelectableChannel /TO/ a FileDescriptor" 
> seems awkward. The verbiage in the java.nio.channels package 
> description uses "from," e.g.,
> "An appropriate channel can be constructed from an InputStream or an 
> OutputStream, and conversely an InputStream or an OutputStream can be 
> constructed from a channel."
Channel is defined to be ".. an open connection to an entity such as 
..." so I tried to be consistent with that. You are right that the 
wording in the Channels utility class is a bit different as it is 
defines factory methods for creating adaptors.  So I think I'll leave it 
as is.

> 2: There are two occurrences of {@link java.nio.channels.Selector 
> Selectors} and one of {@code Selector}s. Should not the "s" be either 
> in or out consistently?
You are right, we should try to keep these consistent.

> 3: In the API Note of implReleaseChannel it states "may be invoked 
> while synchronized on the selector and its selected-key set." Should 
> "may" instead be "should?”
Good point, it should "is invoked" rather than "may be invoked".

> 4: For readWriteSelectableChannel might the phrasing
> "read and write directly with the file descriptor"
> be better as
> "read from and write to the resource referenced by the file descriptor" ?
Yes, that would be better.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20180621/fc44d0b1/attachment.html>

More information about the nio-dev mailing list