Skip to content

Commit

Permalink
Fix io not working for some addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Shevchik committed Mar 15, 2018
1 parent dc32099 commit a181129
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/udpserversocketchannel/channel/UdpServerChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket p) throws
}

protected void doWrite(RecyclableArrayList list, InetSocketAddress remote) {
Channel ioChannel = ioChannels.get(remote.hashCode() % ioChannels.size());
Channel ioChannel = ioChannels.get(remote.hashCode() & (ioChannels.size() - 1));
ioChannel.eventLoop().execute(() -> {
try {
for (Object buf : list) {
Expand Down

0 comments on commit a181129

Please sign in to comment.