Skip to content

UnixServerSocketChannel extending java.nio.channels.ServerSocketChannel #92

Open
@faucct

Description

@faucct

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions