On 22/07/11 14:55, Alan Bateman wrote:
Michael McMahon wrote:
But, bind() already closes the impl internally before throwing the
exception.
I was wondering about that and whether this is a bug. Suppose someone
creates an unbound DatagramSocket and then attempts to bind it to a
port. If the bind fails (say port already in use) then it may be
surprising that they can't retry with a different port. Should this
be specified? I see there are cases such as the security exception
where it doesn't the close the impl.
-Alan.
It doesn't seem to be specified either way, though it does seem to be
inconsistent.
I'd be wary about changing the behaviour though
unless there was a strong justification (more than a compiler warning :) )
- Michael.