RFR: 8269481: SctpMultiChannel never releases own file descriptor

Alan Bateman alanb at openjdk.java.net
Tue Jun 29 06:56:09 UTC 2021


On Tue, 29 Jun 2021 00:44:25 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Please review this change to the Unix implementations of `sun.nio.ch.sctp.Sctp*ChannelImpl#kill()` to close the socket if `state == ChannelState.UNINITIALIZED`.

src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpChannelImpl.java line 643:

> 641:             if (state == ChannelState.UNINITIALIZED) {
> 642:                 SctpNet.close(fdVal);
> 643:                 state = ChannelState.KILLED;

It might be better to invert these, meaning set the state to KILL before close(fdVal), just in case the close throws.

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

PR: https://git.openjdk.java.net/jdk/pull/4621


More information about the net-dev mailing list