RFR[8235783]: DatagramSocket::disconnect should allow an implementation to throw UncheckedIOException
Daniel Fuchs
daniel.fuchs at oracle.com
Wed Dec 18 10:55:05 UTC 2019
Hi Alan,
On 18/12/2019 11:01, Alan Bateman wrote:
> I guess my point here is that UncheckedIOException will never be thrown,
> which might be okay if the primary motive is to prepare DatagramSocket
> for the new implementation.
We already have two implementations of DatagramSocket: one is the plain
DatagramSocket, the other is the DatagramSocket adapter created by
DatagramChannel::socket.
Even without preparing for DatagramSocket reimplementation this
is a step forward in homogenizing these two implementations in
the spec.
> DatagramSocket connect does nothing when the socket is closed and we might want specify that some day to avoid the reader wondering if UncheckedIOException will be thrown when the socket is closed.
Oh - I see DatagramChannel::socket adapter also behaves like this
and explicitly ignores the ClosedChannelException.
Is there any reason for letting connect go through if the socket
is closed? I mean - should we change the spec/behavior of
DatagramSocket (and the adapter) to throw in that case?
best regards,
-- daniel
More information about the net-dev
mailing list