Deprecated
since 16.
Java SE 9 added standard methods to set/get socket options, and retrieve the per-Socket supported options effectively rendering this API redundant. Please refer to the corresponding socket's class for the equivalent method to set/get a socket option or retrieve available socket options.
java.net.SocketOption interface. All of the standard options defined
by java.net.Socket , java.net.ServerSocket , and
java.net.DatagramSocket can be set this way, as well as additional
or platform specific options supported by each socket type.
The supportedOptions(Class) method can be called to determine
the complete set of options available (per socket type) on the
current system.
java.nio.channels.NetworkChannel
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | Sockets.
Tells whether TCP_KEEPALIVE options are supported. |
| pack-priv static class | Sockets.
Tells whether TCP_QUICKACK is supported. |
| Modifier and Type | Field and Description |
|---|---|
| private static volatile boolean | |
| private static volatile boolean | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public static < The type of the socket option T> T | Returns: The value of the socket option.the socket s, SocketOption<T> The socket option name)
Deprecated
since 16. use
java. instead.
Returns the value of a socket option from a |
| public static < The type of the socket option T> T | Returns: The value of the socket option.the socket s, SocketOption<T> The socket option name)
Deprecated
since 16. use
java. instead.
Returns the value of a socket option from a |
| public static < The type of the socket option T> T | Returns: The value of the socket option.the socket s, SocketOption<T> The socket option name)
Deprecated
since 16. use
java. instead.
Returns the value of a socket option from a
|
| pack-priv static boolean | |
| private static Map | |
| public static < The type of the socket option T> void | setOption(Socket
the socket s, SocketOption<T> The socket option name, T The value of the socket option. May be null for some
options. value)
Deprecated
since 16. use
java. instead.
Sets the value of a socket option on a |
| public static < The type of the socket option T> void | setOption(ServerSocket
the socket s, SocketOption<T> The socket option name, T The value of the socket option value)
Deprecated
since 16. use
java. instead.
Sets the value of a socket option on a |
| public static < The type of the socket option T> void | setOption(DatagramSocket
the socket s, SocketOption<T> The socket option name, T The value of the socket option value)
Deprecated
since 16. use
java. instead.
Sets the value of a socket option on a |
| public static Set | Returns: A set of socket optionsthe type of java.net socket socketType)
Deprecated
for removal since 16. use
Socket#supportedOptions(), ServerSocket#supportedOptions(),
or DatagramSocket#supportedOptions() instead.
Returns a set of |
| checkedReusePort | back to summary |
|---|---|
| private static volatile boolean checkedReusePort | |
| isReusePortAvailable | back to summary |
|---|---|
| private static volatile boolean isReusePortAvailable | |
| options | back to summary |
|---|---|
| private static final Map<Class<?>, Set<SocketOption<?>>> options | |
| Sockets | back to summary |
|---|---|
| private Sockets() | |
| checkValueType | back to summary |
|---|---|
| private static void checkValueType(Object value, Class<?> type) | |
| getOption | back to summary |
|---|---|
| public static <T> T getOption(Socket s, SocketOption<T> name) throws IOException
Returns the value of a socket option from a
| |
| getOption | back to summary |
|---|---|
| public static <T> T getOption(ServerSocket s, SocketOption<T> name) throws IOException
Returns the value of a socket option from a
| |
| getOption | back to summary |
|---|---|
| public static <T> T getOption(DatagramSocket s, SocketOption<T> name) throws IOException
Returns the value of a socket option from a
| |
| isReusePortAvailable | back to summary |
|---|---|
| pack-priv static boolean isReusePortAvailable() Tells whether SO_REUSEPORT is supported. | |
| optionSets | back to summary |
|---|---|
| private static Map | |
| setOption | back to summary |
|---|---|
| public static <T> void setOption(Socket s, SocketOption<T> name, T value) throws IOException
Sets the value of a socket option on a
| |
| setOption | back to summary |
|---|---|
| public static <T> void setOption(ServerSocket s, SocketOption<T> name, T value) throws IOException
Sets the value of a socket option on a
| |
| setOption | back to summary |
|---|---|
| public static <T> void setOption(DatagramSocket s, SocketOption<T> name, T value) throws IOException
Sets the value of a socket option on a
| |
| supportedOptions | back to summary |
|---|---|
| public static Set Deprecated for removal since 16. use Returns a set of
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| AVAILABLE | back to summary |
|---|---|
| pack-priv static final boolean AVAILABLE | |
| KeepAliveOptions | back to summary |
|---|---|
| pack-priv KeepAliveOptions() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| available | back to summary |
|---|---|
| pack-priv static final boolean available | |
| QuickAck | back to summary |
|---|---|
| pack-priv QuickAck() | |