RFR[8243408]: 'Inconsistent Exceptions are thrown by MulticastSocket when sending a DatagramPacket to port 0'

Patrick Concannon patrick.concannon at oracle.com
Wed Apr 22 19:18:56 UTC 2020


Hi,

Could someone please review my fix for JDK-8243408 'Inconsistent 
Exceptions are thrown by MulticastSocket when sending a DatagramPacket 
to port 0'?

Currently, MulticastSocket.send(DatagramPacket, byte) throws an 
IOException when sending to port 0 on Unix and macOS, but doesn’t throw 
on Windows and Solaris.
This fix adds a check for port == 0 to MulticastSocket's 2-arg send 
method to ensure a consistent exceptionis thrown across platforms, i.e. 
a SocketException. This follows on from a similar change made to the 
DatagramSocket and DatagramChannel's send method. See JDK-8240533 
<https://bugs.openjdk.java.net/browse/JDK-8240533> for more details


bug: https://bugs.openjdk.java.net/browse/JDK-8243408
webrev: http://cr.openjdk.java.net/~pconcannon/8243408/webrevs/webrev.00/


Kind regards,

Patrick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20200422/5882db98/attachment.htm>


More information about the net-dev mailing list