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 — DatagramChannel: Don't enforce InetSocketAddress by normanmaurer · Pull Request #15947 · netty/netty

Conversation

@normanmaurer

@normanmaurer normanmaurer commented Nov 29, 2025

Copy link
Copy Markdown
Member

Motivation:

We shouldn't enforce InetSocketAddress for DatagramChannel as this will make it impossible to use the same interface / implementation for UDS

Modifications:

Remove overrides

Result:

More flexibility and possible code sharing in the future

Sorry, something went wrong.

Uh oh!

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

All reactions
@normanmaurer
DatagramChannel: Don't enforce InetSocketAddress
1173dd4
Motivation:

We shouldn't enforce InetSocketAddress for DatagramChannel as this will make it impossible to use the same interface / implementation for UDS

Modifications:

Remove overrides

Result:

More flexibility and possible code sharing in the future
@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Nov 30, 2025
@normanmaurer
normanmaurer merged commit ea55518 into 5.0 Nov 30, 2025
@normanmaurer
normanmaurer deleted the datagram_address branch November 30, 2025 08:01
@normanmaurer

normanmaurer commented Nov 30, 2025

Copy link
Copy Markdown
Member Author

Merging ... @chrisvest PTAL once back

All reactions

Sorry, something went wrong.

Uh oh!

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

chrisvest
chrisvest reviewed Dec 4, 2025
View reviewed changes
Comment thread transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannel.java
InetSocketAddress recipient = segmentedDatagramPacket.recipient();
InetSocketAddress sender = segmentedDatagramPacket.sender();
InetSocketAddress recipient = (InetSocketAddress) segmentedDatagramPacket.recipient();
InetSocketAddress sender = (InetSocketAddress) segmentedDatagramPacket.sender();

@chrisvest chrisvest Dec 4, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need recipient and sender to be InetSocketAddress because DatagramPacket is fine with them being just SocketAddress.

Sorry, something went wrong.

Uh oh!

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

normanmaurer reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannel.java
byteBuf.writerIndex(bytesReceived);
InetSocketAddress local = localAddress();
InetSocketAddress local = (InetSocketAddress) localAddress();
DatagramPacket packet = msg.newDatagramPacket(byteBuf, local);

@chrisvest chrisvest Dec 4, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can get away with making newDatagramPacket take a SocketAddress recipient, instead of doing this cast.

Sorry, something went wrong.

Uh oh!

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

All reactions

@normanmaurer normanmaurer Dec 4, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment we only support this for INET / INET6. So we can't... We might change this

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannel.java
}

InetSocketAddress local = localAddress();
InetSocketAddress local = (InetSocketAddress) localAddress();

@chrisvest chrisvest Dec 4, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment for the newDatagramPacket calls below.

Sorry, something went wrong.

Uh oh!

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

All reactions
normanmaurer added a commit that referenced this pull request Dec 4, 2025
@normanmaurer
Cleanup some code in EpollDatagramChannel as a followup of #15947
38f5c73
@normanmaurer normanmaurer mentioned this pull request Sep 22, 2026
suspend race fix #17588
Closed
@normanmaurer normanmaurer mentioned this pull request Oct 20, 2026
fix iouring zerocopy iov overwrite #17936
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chrisvest chrisvest chrisvest left review comments

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

5.0.0.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

@normanmaurer @chrisvest
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.