This is the mail archive of the
mailing list for the Java project.
Re: PATCH for java.nio FileChannel and MappedByteBuffer
Michael Koch wrote:
I probably need to flesh out the socket implementation before
checking this code in, but feedback would be welcome before then.
Fleshing out socket implementation seems to be good idea but keep in
mind the official API which uses FileDescriptor (bleh!).
Actually, the current implementation appears to never set or use
the fd field of a SocketImpl. And as far as I can tell, there is
no need for us to bother with it, as it's a protected field in
an implementation-private subclass.
I.e. if somebody subclasses SocketImpl, then it's their problem
how they implement their subclass, but if they use our PlainSocketImpl
or PlainDatagramSocketImpl there appears to be no way their code can
access the fd field, so there is no point us trying to create a
FileDescriptor for the socket.
So I don't think there is any need to worry about this issue.
At some point we can think about whether we should optimize
SocketChannelImpl by not using a PlainSocketImpl, but I don't
think there is any urgency about this issue.
I.e. I think my patch is fine the way it is.