Skip to content

shutdownOutput for EpollDomainSocketChannel #4882

@rtimush

Description

@rtimush

I see a protected shutdownOutput0 method in AbstractEpollStreamChannel but there is no public shutdownOutput in EpollDomainSocketChannel.

I suppose shutdownOutput implementation from EpollSocketChannel can be moved to AbstractEpollStreamChannel:

    @Override
    public ChannelFuture shutdownOutput(final ChannelPromise promise) {
        Executor closeExecutor = ((EpollSocketChannelUnsafe) unsafe()).prepareToClose();
        if (closeExecutor != null) {
            closeExecutor.execute(new OneTimeTask() {
                @Override
                public void run() {
                    shutdownOutput0(promise);
                }
            });
        } else {
            EventLoop loop = eventLoop();
            if (loop.inEventLoop()) {
                shutdownOutput0(promise);
            } else {
                loop.execute(new OneTimeTask() {
                    @Override
                    public void run() {
                        shutdownOutput0(promise);
                    }
                });
            }
        }
        return promise;
    }

I expect this change to help with docker-java/docker-java#472. If you consider this to be a valid solution then I can create a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions