Summary
The javadoc on java.net.SocketOptions.SO_LINGER
field will be updated to clarify the type of the value this field can be expected to have when used in SocketOptions.getOption()
and SocketOptions.setOption()
methods.
Problem
The SocketOptions.SO_LINGER
allows for the value to be either Boolean.FALSE
(when the option is disabled) or an integer representing the linger interval (when the option is enabled). This detail isn't currently explained in the field's javadoc.
Solution
The javadoc of the SocketOptions.SO_LINGER
field will be updated to specify when the field's value will be Boolean.FALSE
and when an integer.
Specification
/**
* See {@link StandardSocketOptions#SO_LINGER} for description of this socket option.
* <p>
* Set the value to {@code Boolean.FALSE} or an integer less than {@code 0} with
* {@link #setOption(int, Object)} to disable this option. An integer greater than or equal to
* {@code 0} will enable the option and will represent the linger interval.
* <p>
* If this option is enabled then {@link #getOption(int)} will return an integer value
* representing the linger interval, else the return value will be {@code Boolean.FALSE}.
*
* @see Socket#setSoLinger
* @see Socket#getSoLinger
*/
@Native public static final int SO_LINGER = 0x0080;
- csr of
-
JDK-8329825 Clarify the value type for java.net.SocketOptions.SO_LINGER
-
- Resolved
-