RFR[8236105]: Behaviors of DatagramSocket/DatagramChannel::socket send methods are not always consistent
Patrick Concannon
patrick.concannon at oracle.com
Fri Jan 17 12:50:30 UTC 2020
Hi Chris,
Thanks for your feedback. I've created a related bug for the points
you've raised and I will take a look at them once this issue has been
fixed.
The new issue be found here:
https://bugs.openjdk.java.net/browse/JDK-8237471
Kind regards,
Patrick
On 17/01/2020 12:03, Chris Hegarty wrote:
> Patrick,
>
>> On 13 Jan 2020, at 16:30, Patrick Concannon
>> <patrick.concannon at oracle.com <mailto:patrick.concannon at oracle.com>>
>> wrote:
>>
>> Hi,
>>
>> Could someone please review my fix and CSR for issue JDK-8236105
>> 'Behaviors of DatagramSocket/DatagramChannel::socket send methods are
>> not always consistent' ?
>>
>> The behaviour of the send methods for DatagramSocket,
>> MulticastSocket, DatagramChannel and DatagramSocketAdaptor are not
>> consistent when given a DatagramPacket with invalid details. This fix
>> adds a check to ensure that the exceptions thrown by the send method
>> of DatagramSocket and MulticastSocket match the exception thrown by
>> DatagramChannel and DatagramSocketAdaptor i.e. IllegalArgumentException
>>
>>
>> bug: https://bugs.openjdk.java.net/browse/JDK-8236105
>>
>> CSR: https://bugs.openjdk.java.net/browse/JDK-8236940
>> webrev:
>> http://cr.openjdk.java.net/~pconcannon/8236105/webrevs/webrev.00/
>
>
> Mostly looks good.
>
> 1) While investigating how one can create a datagram packet with an
> out-of-range port number I find that DatagramPacket::setPort is
> missing an "@throws IAE - if the given port is outside the range of
> valid port values". This could be added to this CSR?
>
> 2) DatagramPacket::setSocketAddress - same comment as above
>
> 3) Argh! several DatagramPacket constructors are also missing the IAE!
>
> 4) If we fix 1-3 above, then DatagramPacket would be a reasonable place
> to specify the range of valid port values ( or is that specified
> elsewhere? )
>
> -Chris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20200117/f5f4677b/attachment.htm>
More information about the net-dev
mailing list