Skip to content

Commit d5afc05

Browse files
committed
Add SO_REUSEPORT option
1 parent 1e32dc0 commit d5afc05

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

common/src/main/java/dev/ryanhcode/sable/mixin/udp/ServerConnectionListenerMixin.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import io.netty.bootstrap.Bootstrap;
1010
import io.netty.channel.*;
1111
import io.netty.channel.epoll.Epoll;
12+
import io.netty.channel.epoll.EpollChannelOption;
1213
import io.netty.channel.epoll.EpollDatagramChannel;
1314
import io.netty.channel.local.LocalAddress;
1415
import io.netty.channel.local.LocalServerChannel;
@@ -67,6 +68,7 @@ public class ServerConnectionListenerMixin implements ServerConnectionListenerEx
6768
this.channels.add(new Bootstrap()
6869
.channel(channelClass)
6970
.option(ChannelOption.SO_BROADCAST, true)
71+
.option(EpollChannelOption.SO_REUSEPORT, true)
7072
.handler(new ChannelInitializer<>() {
7173
@Override
7274
protected void initChannel(final Channel channel) {
@@ -93,6 +95,7 @@ protected void initChannel(final Channel channel) {
9395
this.channels.add(new Bootstrap()
9496
.channel(LocalServerChannel.class)
9597
.option(ChannelOption.SO_BROADCAST, true)
98+
.option(EpollChannelOption.SO_REUSEPORT, true)
9699
.handler(new ChannelInitializer<>() {
97100
@Override
98101
protected void initChannel(final Channel channel) {

0 commit comments

Comments
 (0)