tokio icon indicating copy to clipboard operation
tokio copied to clipboard

util: provide SocketAddr for UdpFramed decode errors

Open jasta opened this issue 3 years ago • 1 comments

Motivation

Decode errors for UdpFramed without the SocketAddr would make it impossible to determine the origin of the malformed packet even if to just log the error.

Solution

As discussed in #4589, the most straight forward solution is to just expand the error type to be a tuple including the SocketAddr. Note however that the SocketAddr must be optional because it is possible for recvfrom to fail globally without a specific peer to report.

Closes #4589

jasta avatar May 04 '22 21:05 jasta

Adding a test case that at least shows why some API change is important while we leave the exact API up in the air.

jasta avatar May 05 '22 20:05 jasta

Since this is blocked on a breaking tokio-util release, I will close it for now. Your changes wont get lost since the issue should show up when we make the next breaking tokio-util release.

Darksonn avatar Apr 16 '23 14:04 Darksonn