-
Bug
-
Resolution: Fixed
-
P4
-
14
-
b08
DatagramChannel::disconnect throws IOException while DatagramSocket::disconnect does not. As a result, the DatagramChannel::socket adaptor which calls DatagramChannel::disconnect currently catches IOException and rethrows it as Error.
On the other hand, DatagramChannel::disconnect has been fixed to rebind the socket in those cases where the underlying platform `disconnect` changes the local socket address. This unfortunately introduce the possibility that `disconnect` will fail. DatagramChannel::disconnect may throw an IOException in that case and its API documentation has been updated to recommend closing the socket if that happens. SeeJDK-8231260 and JDK-8231259.
This means that the risk of the DatagramChannel::socket adapter throwing an Error has slightly increased. This is a bit hostile to clients of this API.
The proposal is to change the DatagramChannel::socket adapter to throw UncheckedIOException instead, and update the specification of DatagramSocket::disconnect to document that an implementation may throw UncheckedIOException, and to recommend closing the socket in that case, in much the same way that was done for DatagramChannel.
On the other hand, DatagramChannel::disconnect has been fixed to rebind the socket in those cases where the underlying platform `disconnect` changes the local socket address. This unfortunately introduce the possibility that `disconnect` will fail. DatagramChannel::disconnect may throw an IOException in that case and its API documentation has been updated to recommend closing the socket if that happens. See
This means that the risk of the DatagramChannel::socket adapter throwing an Error has slightly increased. This is a bit hostile to clients of this API.
The proposal is to change the DatagramChannel::socket adapter to throw UncheckedIOException instead, and update the specification of DatagramSocket::disconnect to document that an implementation may throw UncheckedIOException, and to recommend closing the socket in that case, in much the same way that was done for DatagramChannel.
- blocks
-
JDK-8230211 Prepare DatagramSocket for alternative DatagramSocketImpl
-
- Resolved
-
- csr for
-
JDK-8236076 DatagramSocket::connect and DatagramSocket::disconnect should allow an implementation to throw UncheckedIOException
-
- Closed
-
- relates to
-
JDK-8247324 Release Note: DatagramSocket::disconnect Allows an Implementation to Throw UncheckedIOException
-
- Closed
-