Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for recvmmsg(...) even with connected datagram channels w… #9539
Conversation
…hen using native epoll transport Motivation: 394a1b3 added support for recvmmsg(...) for unconnected datagram channels, this change also allows to use recvmmsg(...) with connected datagram channels. Modifications: - Always try to use recvmmsg(...) if configured to do so - Adjust unit test to cover it Result: Less syscalls when reading datagram packets
...ive-epoll/src/main/java/io/netty/channel/epoll/EpollDatagramChannel.java
Outdated
Show resolved
Hide resolved
| : byteBuf.writableBytes(); | ||
| allocHandle.attemptedBytesRead(writable); | ||
|
|
||
| byteBuf.writerIndex(byteBuf.readerIndex() + writable); |
This comment has been minimized.
This comment has been minimized.
njhill
Sep 6, 2019
Member
I'm not sure this is right.. isn't it the capacity that would need to be reduced in the case that 0 < maxDatagramPacketSize < byteBuf.writeableBytes()? Though i'm not sure we would really want to do that since it could involve actually reallocation/copying internally...
This comment has been minimized.
This comment has been minimized.
normanmaurer
Sep 6, 2019
Author
Member
@njhil arg... I think you are right and it should be: byteBuf.writerIndex(byteBuf.capacity() - writable);
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
normanmaurer
Sep 6, 2019
Author
Member
actually also this is not 100 % correct... Should be good now with the latest change. PTAL again
normanmaurer
added a commit
that referenced
this pull request
Sep 6, 2019
#9539) Motivation: 394a1b3 added support for recvmmsg(...) for unconnected datagram channels, this change also allows to use recvmmsg(...) with connected datagram channels. Modifications: - Always try to use recvmmsg(...) if configured to do so - Adjust unit test to cover it Result: Less syscalls when reading datagram packets
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
normanmaurer commentedSep 4, 2019
…hen using native epoll transport
Motivation:
394a1b3 added support for recvmmsg(...) for unconnected datagram channels, this change also allows to use recvmmsg(...) with connected datagram channels.
Modifications:
Result:
Less syscalls when reading datagram packets