On Wed, 20 Nov 2024 13:41:40 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> Imagine `bind()` succeeding, yet `connect()` failing due to an `IAE` thrown 
>> by `SocketImpl#connect()`. This would leave the socket in `BOUND` state. 
>> Hence, shouldn't we include the `connect()` in the try-catch block too?
>
> I don't mind if we have a broader try-finally but it would be a bug if 
> connect were to throw IAE. All the validation should be done before 
> delegating to the SocketImpl.

@AlanBateman, this assertion causes `IDNTest` to fail:


java.lang.AssertionError
        at java.base/java.net.Socket.<init>(Socket.java:457)
        at java.base/java.net.Socket.<init>(Socket.java:276)
        at IDNTest.main(IDNTest.java:37)


How shall I proceed?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22160#discussion_r1856218107

Reply via email to