diff --git a/reactor-netty-core/src/main/java/reactor/netty/channel/ChannelOperations.java b/reactor-netty-core/src/main/java/reactor/netty/channel/ChannelOperations.java index 9603508beb..47c14cb133 100644 --- a/reactor-netty-core/src/main/java/reactor/netty/channel/ChannelOperations.java +++ b/reactor-netty-core/src/main/java/reactor/netty/channel/ChannelOperations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2024 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2011-2025 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -704,7 +704,7 @@ static final class DisposedChannel extends AbstractChannel { DisposedChannel(Channel actual) { super(null); this.metadata = actual.metadata(); - this.config = new DefaultChannelConfig(this); + this.config = new DisposedChannelConfig(this); this.localAddress = actual.localAddress(); this.remoteAddress = actual.remoteAddress(); } @@ -788,6 +788,19 @@ public void connect(SocketAddress remoteAddress, SocketAddress localAddress, Cha } } + static final class DisposedChannelConfig extends DefaultChannelConfig { + + DisposedChannelConfig(Channel channel) { + super(channel); + } + + @Override + public ChannelConfig setAutoRead(boolean autoRead) { + // no-op + return this; + } + } + static final class DisposedConnection implements Connection { final Channel channel;