-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P2
-
Affects Version/s: repo-loom
-
Component/s: core-libs
As part of conformance test dev for the amended spec in java.net area, it's observed that DatagramSocket:receive() behavior is not as per the spec for the below scenario.
"This method is interruptible in the following circumstances:
The datagram socket is associated with a DatagramChannel. In that case, interrupting a thread receiving a datagram packet will close the underlying channel and cause this method to throw ClosedByInterruptException with the interrupt status set."
Expected - ClosedByInterruptException
Actual behavior is - java.net.SocketException: Socket closed is thrown.
Please find the attached code to demonstrate the behavior
"This method is interruptible in the following circumstances:
The datagram socket is associated with a DatagramChannel. In that case, interrupting a thread receiving a datagram packet will close the underlying channel and cause this method to throw ClosedByInterruptException with the interrupt status set."
Expected - ClosedByInterruptException
Actual behavior is - java.net.SocketException: Socket closed is thrown.
Please find the attached code to demonstrate the behavior