Class SocketOptionUtils
java.lang.Object
io.servicetalk.transport.netty.internal.SocketOptionUtils
Utilities to convert
SocketOptions.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidaddOption(Map<io.netty.channel.ChannelOption, Object> channelOpts, SocketOption<T> option, T value) static <T> TgetOption(SocketOption<T> option, io.netty.channel.ChannelConfig config, Long idleTimeoutMs) Get aSocketOptionvalue fromChannelConfig.
-
Method Details
-
addOption
public static <T> void addOption(Map<io.netty.channel.ChannelOption, Object> channelOpts, SocketOption<T> option, T value) - Type Parameters:
T- the type of theSocketOptionvalue- Parameters:
channelOpts- theMapinto which add the convertedSocketOptionoption- theSocketOptionto convert and addvalue- the value to add- Throws:
IllegalArgumentException- if the specifiedSocketOptionis not supported
-
getOption
@Nullable public static <T> T getOption(SocketOption<T> option, io.netty.channel.ChannelConfig config, 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:
IllegalArgumentException- if the specifiedSocketOptionis not supported
-