GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ChannelConfig: Cleanup implementations by normanmaurer · Pull Request #15992 · netty/netty

ChannelConfig: Cleanup implementations #15992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
normanmaurer merged 2 commits into 5.0 from config_cleanup
Dec 9, 2025

Uh oh!

There was an error while loading. Please reload this page.

Merged

ChannelConfig: Cleanup implementations #15992

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
39fee27
ChannelConfig: Cleanup implementations
normanmaurer Dec 8, 2025
299b1da
remove leftover
normanmaurer Dec 9, 2025
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

63 changes: 2 additions & 61 deletions 63 transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollChannelConfig.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
*/
package io.netty.channel.epoll;

import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.Channel;
import io.netty.channel.ChannelConfig;
import io.netty.channel.ChannelException;
import io.netty.channel.ChannelOption;
import io.netty.channel.DefaultChannelConfig;
import io.netty.channel.MessageSizeEstimator;
import io.netty.channel.RecvByteBufAllocator;
import io.netty.channel.WriteBufferWaterMark;
import io.netty.channel.unix.IntegerUnixChannelOption;
import io.netty.channel.unix.RawUnixChannelOption;

Expand Down Expand Up @@ -95,32 +93,7 @@ public <T> boolean setOption(ChannelOption<T> option, T value) {
}

@Override
public EpollChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis) {
super.setConnectTimeoutMillis(connectTimeoutMillis);
return this;
}

@Override
@Deprecated
public EpollChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead) {
super.setMaxMessagesPerRead(maxMessagesPerRead);
return this;
}

@Override
public EpollChannelConfig setWriteSpinCount(int writeSpinCount) {
super.setWriteSpinCount(writeSpinCount);
return this;
}

@Override
public EpollChannelConfig setAllocator(ByteBufAllocator allocator) {
super.setAllocator(allocator);
return this;
}

@Override
public EpollChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator) {
public ChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator) {
if (!(allocator.newHandle() instanceof RecvByteBufAllocator.ExtendedHandle)) {
throw new IllegalArgumentException("allocator.newHandle() must return an object of type: " +
RecvByteBufAllocator.ExtendedHandle.class);
Expand All @@ -129,38 +102,6 @@ public EpollChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator
return this;
}

@Override
public EpollChannelConfig setAutoRead(boolean autoRead) {
super.setAutoRead(autoRead);
return this;
}

@Override
@Deprecated
public EpollChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
return this;
}

@Override
@Deprecated
public EpollChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
return this;
}

@Override
public EpollChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
super.setWriteBufferWaterMark(writeBufferWaterMark);
return this;
}

@Override
public EpollChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
super.setMessageSizeEstimator(estimator);
return this;
}

private void checkChannelNotRegistered() {
if (channel.isRegistered()) {
throw new IllegalStateException("EpollMode can only be changed before channel is registered");
Expand Down
3 changes: 2 additions & 1 deletion 3 transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannel.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.netty.buffer.ByteBufAllocator;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelOption;
import io.netty.channel.ChannelOutboundBuffer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ChannelPromise;
Expand Down Expand Up @@ -146,7 +147,7 @@ public ChannelFuture joinGroup(InetAddress multicastAddress, ChannelPromise prom
case INET6:
case INET:
try {
NetworkInterface iface = config().getNetworkInterface();
NetworkInterface iface = config.getOption(ChannelOption.IP_MULTICAST_IF);
if (iface == null) {
iface = NetworkInterface.getByInetAddress(((InetSocketAddress) localAddress()).getAddress());
}
Expand Down
70 changes: 27 additions & 43 deletions 70 transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannelConfig.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,9 @@ int getSendBufferSize() {
}
}

EpollDatagramChannelConfig setSendBufferSize(int sendBufferSize) {
private void setSendBufferSize(int sendBufferSize) {
try {
((AbstractEpollChannel) channel).socket.setSendBufferSize(sendBufferSize);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
Expand All @@ -189,78 +188,73 @@ int getReceiveBufferSize() {
}
}

EpollDatagramChannelConfig setReceiveBufferSize(int receiveBufferSize) {
private void setReceiveBufferSize(int receiveBufferSize) {
try {
((AbstractEpollChannel) channel).socket.setReceiveBufferSize(receiveBufferSize);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}

int getTrafficClass() {
private int getTrafficClass() {
try {
return ((AbstractEpollChannel) channel).socket.getTrafficClass();
} catch (IOException e) {
throw new ChannelException(e);
}
}

EpollDatagramChannelConfig setTrafficClass(int trafficClass) {
private void setTrafficClass(int trafficClass) {
try {
((AbstractEpollChannel) channel).socket.setTrafficClass(trafficClass);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}

boolean isReuseAddress() {
private boolean isReuseAddress() {
try {
return ((AbstractEpollChannel) channel).socket.isReuseAddress();
} catch (IOException e) {
throw new ChannelException(e);
}
}

EpollDatagramChannelConfig setReuseAddress(boolean reuseAddress) {
private void setReuseAddress(boolean reuseAddress) {
try {
((AbstractEpollChannel) channel).socket.setReuseAddress(reuseAddress);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}

boolean isBroadcast() {
private boolean isBroadcast() {
try {
return ((AbstractEpollChannel) channel).socket.isBroadcast();
} catch (IOException e) {
throw new ChannelException(e);
}
}

EpollDatagramChannelConfig setBroadcast(boolean broadcast) {
private void setBroadcast(boolean broadcast) {
try {
((AbstractEpollChannel) channel).socket.setBroadcast(broadcast);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}

boolean isLoopbackModeDisabled() {
private boolean isLoopbackModeDisabled() {
try {
return ((AbstractEpollChannel) channel).socket.isLoopbackModeDisabled();
} catch (IOException e) {
throw new ChannelException(e);
}
}

EpollDatagramChannelConfig setLoopbackModeDisabled(boolean loopbackModeDisabled) {
private void setLoopbackModeDisabled(boolean loopbackModeDisabled) {
try {
((AbstractEpollChannel) channel).socket.setLoopbackModeDisabled(loopbackModeDisabled);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
Expand All @@ -274,45 +268,42 @@ int getTimeToLive() {
}
}

EpollDatagramChannelConfig setTimeToLive(int ttl) {
private void setTimeToLive(int ttl) {
try {
((AbstractEpollChannel) channel).socket.setTimeToLive(ttl);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}

InetAddress getInterface() {
private InetAddress getInterface() {
try {
return ((AbstractEpollChannel) channel).socket.getInterface();
} catch (IOException e) {
throw new ChannelException(e);
}
}

EpollDatagramChannelConfig setInterface(InetAddress interfaceAddress) {
private void setInterface(InetAddress interfaceAddress) {
try {
((AbstractEpollChannel) channel).socket.setInterface(interfaceAddress);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}

NetworkInterface getNetworkInterface() {
private NetworkInterface getNetworkInterface() {
try {
return ((AbstractEpollChannel) channel).socket.getNetworkInterface();
} catch (IOException e) {
throw new ChannelException(e);
}
}

EpollDatagramChannelConfig setNetworkInterface(NetworkInterface networkInterface) {
private void setNetworkInterface(NetworkInterface networkInterface) {
try {
AbstractEpollChannel datagramChannel = (AbstractEpollChannel) channel;
datagramChannel.socket.setNetworkInterface(networkInterface);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
Expand All @@ -321,7 +312,7 @@ EpollDatagramChannelConfig setNetworkInterface(NetworkInterface networkInterface
/**
* Returns {@code true} if the SO_REUSEPORT option is set.
*/
boolean isReusePort() {
private boolean isReusePort() {
try {
return ((AbstractEpollChannel) channel).socket.isReusePort();
} catch (IOException e) {
Expand All @@ -336,10 +327,9 @@ boolean isReusePort() {
* Be aware this method needs be called before {@link EpollDatagramChannel#bind(java.net.SocketAddress)} to have
* any affect.
*/
EpollDatagramChannelConfig setReusePort(boolean reusePort) {
private void setReusePort(boolean reusePort) {
try {
((AbstractEpollChannel) channel).socket.setReusePort(reusePort);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
Expand All @@ -349,7 +339,7 @@ EpollDatagramChannelConfig setReusePort(boolean reusePort) {
* Returns {@code true} if <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_TRANSPARENT</a> is enabled,
* {@code false} otherwise.
*/
boolean isIpTransparent() {
private boolean isIpTransparent() {
try {
return ((AbstractEpollChannel) channel).socket.isIpTransparent();
} catch (IOException e) {
Expand All @@ -361,10 +351,9 @@ boolean isIpTransparent() {
* If {@code true} is used <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_TRANSPARENT</a> is enabled,
* {@code false} for disable it. Default is disabled.
*/
EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent) {
private void setIpTransparent(boolean ipTransparent) {
try {
((AbstractEpollChannel) channel).socket.setIpTransparent(ipTransparent);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
Expand All @@ -374,7 +363,7 @@ EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent) {
* Returns {@code true} if <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_FREEBIND</a> is enabled,
* {@code false} otherwise.
*/
boolean isFreeBind() {
private boolean isFreeBind() {
try {
return ((AbstractEpollChannel) channel).socket.isIpFreeBind();
} catch (IOException e) {
Expand All @@ -386,10 +375,9 @@ boolean isFreeBind() {
* If {@code true} is used <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_FREEBIND</a> is enabled,
* {@code false} for disable it. Default is disabled.
*/
EpollDatagramChannelConfig setFreeBind(boolean freeBind) {
private void setFreeBind(boolean freeBind) {
try {
((AbstractEpollChannel) channel).socket.setIpFreeBind(freeBind);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
Expand All @@ -399,7 +387,7 @@ EpollDatagramChannelConfig setFreeBind(boolean freeBind) {
* Returns {@code true} if <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_RECVORIGDSTADDR</a> is
* enabled, {@code false} otherwise.
*/
boolean isIpRecvOrigDestAddr() {
private boolean isIpRecvOrigDestAddr() {
try {
return ((AbstractEpollChannel) channel).socket.isIpRecvOrigDestAddr();
} catch (IOException e) {
Expand All @@ -411,10 +399,9 @@ boolean isIpRecvOrigDestAddr() {
* If {@code true} is used <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_RECVORIGDSTADDR</a> is
* enabled, {@code false} for disable it. Default is disabled.
*/
EpollDatagramChannelConfig setIpRecvOrigDestAddr(boolean ipTransparent) {
private void setIpRecvOrigDestAddr(boolean ipTransparent) {
try {
((AbstractEpollChannel) channel).socket.setIpRecvOrigDestAddr(ipTransparent);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
Expand All @@ -424,7 +411,7 @@ EpollDatagramChannelConfig setIpRecvOrigDestAddr(boolean ipTransparent) {
* Returns {@code true} if <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_MULTICAST_ALL</a> (or
* IPV6_MULTICAST_ALL for IPV6) is enabled, {@code false} otherwise.
*/
boolean isIpMulticastAll() {
private boolean isIpMulticastAll() {
try {
return ((AbstractEpollChannel) channel).socket.isIpMulticastAll();
} catch (IOException e) {
Expand All @@ -436,10 +423,9 @@ boolean isIpMulticastAll() {
* If {@code true} is used <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_MULTICAST_ALL</a> is
* enabled (or IPV6_MULTICAST_ALL for IPV6), {@code false} for disable it. Default is enabled.
*/
EpollDatagramChannelConfig setIpMulticastAll(boolean multicastAll) {
private void setIpMulticastAll(boolean multicastAll) {
try {
((AbstractEpollChannel) channel).socket.setIpMulticastAll(multicastAll);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
Expand All @@ -453,9 +439,8 @@ EpollDatagramChannelConfig setIpMulticastAll(boolean multicastAll) {
* {@link RecvByteBufAllocator}. You can use {@code 0} to disable the usage of recvmmsg, any other bigger value
* will enable it.
*/
EpollDatagramChannelConfig setMaxDatagramPayloadSize(int maxDatagramSize) {
private void setMaxDatagramPayloadSize(int maxDatagramSize) {
this.maxDatagramSize = ObjectUtil.checkPositiveOrZero(maxDatagramSize, "maxDatagramSize");
return this;
}

/**
Expand All @@ -470,14 +455,13 @@ int getMaxDatagramPayloadSize() {
* @param gro {@code true} if {@code UDP_GRO} should be enabled, {@code false} otherwise.
* @return this.
*/
EpollDatagramChannelConfig setUdpGro(boolean gro) {
private void setUdpGro(boolean gro) {
try {
((AbstractEpollChannel) channel).socket.setUdpGro(gro);
} catch (IOException e) {
throw new ChannelException(e);
}
this.gro = gro;
return this;
}

/**
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.