JDK-8236852 : DatagramSocket / DatagramChannel do not specify what happens when sending to port 0
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2020-01-09
  • Updated: 2020-04-08
  • Resolved: 2020-04-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The behavior of DatagramSocket / DatagramChannel send method when the target address is specified to port 0 appears to be system dependent:

on Linux / macOS: an IOException is thrown.
on Windows / Solaris: no exception is thrown.

Whether the spec and implementation should be changed to always throw IllegalArgumentException instead should be examined.