I can be naive, but this looks like a reasonable thing to do. Can anyone explain why wasn't this done?
From a first glance this cannot be done because of two reasons:
UnixServerSocketChannel extends NativeServerSocketChannel, while NativeServerSocketChannel cannot extend ServerSocketChannel, because it does not bind to socket-addresses but file-descriptors. Could UnixServerSocketChannel extend ServerSocketChannel directly while sharing code with NativeServerSocketChannel in a different way?
- While
ServerSocketChannel#validOps() are only SelectionKey.OP_ACCEPT, the UnixServerSocketChannel#validOps() are SelectionKey.OP_ACCEPT | SelectionKey.OP_READ for some reasons I don't understand. I have tried changing it to SelectionKey.OP_ACCEPT, but the tests still pass (so do NativeServerSocketChannel tests). Why is SelectionKey.OP_READ required there?