8053479: (dc) DatagramChannel.read() throws exception instead of discarding data when buffer too small

Alan Bateman Alan.Bateman at oracle.com
Wed Jan 15 09:04:44 UTC 2020


If the DatagramChannel receive or read methods are called with a buffer 
that has fewer bytes remaining that is required for the datagram then 
the remainder is silently discarded. This scenario isn't handled 
correctly on Windows when the channel's socket is connected because the 
implementation doesn't handle WSAEMSGSIZE. Not an issue on other 
platforms and not an issue for the not-connected case on Windows. The 
fix to handle WSAEMSGSIZE is very simple:
     http://cr.openjdk.java.net/~alanb/8053479/webrev/

-Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20200115/45f72958/attachment.htm>


More information about the nio-dev mailing list