Class SocketOptionUtils
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.SocketOptionUtils
-
public final class SocketOptionUtils extends java.lang.ObjectUtilities to convertSocketOptions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> voidaddOption(java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> channelOpts, java.net.SocketOption<T> option, java.lang.Object value)Convert and add the givenSocketOptionand value to theChannelOptionsMap.static <T> TgetOption(java.net.SocketOption<T> option, io.netty.channel.ChannelConfig config, java.lang.Long idleTimeoutMs)Get aSocketOptionvalue fromChannelConfig.
-
-
-
Method Detail
-
addOption
public static <T> void addOption(java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> channelOpts, java.net.SocketOption<T> option, java.lang.Object value)Convert and add the givenSocketOptionand value to theChannelOptionsMap.- Type Parameters:
T- the type of theSocketOptionvalue- Parameters:
channelOpts- theMapinto which add the convertedSocketOptionoption- theSocketOptionto convert and addvalue- the value to add- Throws:
java.lang.IllegalArgumentException- if the specifiedSocketOptionis not supported
-
getOption
@Nullable public static <T> T getOption(java.net.SocketOption<T> option, io.netty.channel.ChannelConfig config, @Nullable java.lang.Long idleTimeoutMs)Get aSocketOptionvalue fromChannelConfig.- Type Parameters:
T- the type of theSocketOptionvalue- Parameters:
option- theSocketOptionto getconfig- theChannelConfigto get theSocketOptionfromidleTimeoutMs- value forIDLE_TIMEOUTsocket option- Returns:
- a value of the
SocketOptionof typeTornullif theChannelConfigdoes not have a value for requestedSocketOption - Throws:
java.lang.IllegalArgumentException- if the specifiedSocketOptionis not supported
-
-