How to know when a read is starting and how many bytes were read #12860
isaacrivriv
started this conversation in
General
Replies: 1 comment 1 reply
-
You have to sum up the readable bytes of the ByteBufs that come through channelRead and write, then log and reset in channelReadComplete and flush. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there! I'm trying to build a custom handler for logging extending the LoggingHandler provided by Netty to add additional logging details for things like reads and writes. Specifically, I'm curious if there's a way to get the amount of bytes that pass through the handler when a read from the socket happens (maybe when readComplete is called?) and also when written to the socket (maybe after calling flush?). Also if there's a way to log when a read is actually starting vs when it is completed in the handler (in channelRead of channelReadComplete). Searching around I haven't found a way to make this happen. Anyone have any advice? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions