tokio
tokio copied to clipboard
util: provide SocketAddr for UdpFramed decode errors
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
Adding a test case that at least shows why some API change is important while we leave the exact API up in the air.
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.