Skip to content

Fix statistics tracking for bytes sent and received in MqttChannelAdapter#2235

Open
RicoSuter wants to merge 1 commit into
dotnet:masterfrom
RicoSuter:fix/statistics-swap
Open

Fix statistics tracking for bytes sent and received in MqttChannelAdapter#2235
RicoSuter wants to merge 1 commit into
dotnet:masterfrom
RicoSuter:fix/statistics-swap

Conversation

@RicoSuter
Copy link
Copy Markdown

@RicoSuter RicoSuter commented Feb 16, 2026

The BytesSent and BytesReceived counters in MqttChannelAdapter are swapped — ReceivePacketAsync increments _bytesSent and SendPacketAsync increments _bytesReceived.

@chkr1011
Copy link
Copy Markdown
Collaborator

This is intentional. It depends on the perspective of the usage of the data. When receiving data, it is the actual sent data by the client. And when the server is sending it is the received data of the client. So when I want to expose the received bytes of the client in the server I have to count the sent bytes and name them received bytes in the client statistics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants