Package io.netty.channel.socket.nio
Class NioSocketChannel.NioSocketChannelConfig
- java.lang.Object
-
- io.netty.channel.DefaultChannelConfig
-
- io.netty.channel.socket.DefaultSocketChannelConfig
-
- io.netty.channel.socket.nio.NioSocketChannel.NioSocketChannelConfig
-
- All Implemented Interfaces:
ChannelConfig
,DuplexChannelConfig
,SocketChannelConfig
- Enclosing class:
- NioSocketChannel
private final class NioSocketChannel.NioSocketChannelConfig extends DefaultSocketChannelConfig
-
-
Field Summary
Fields Modifier and Type Field Description private int
maxBytesPerGatheringWrite
-
Fields inherited from class io.netty.channel.socket.DefaultSocketChannelConfig
javaSocket
-
Fields inherited from class io.netty.channel.DefaultChannelConfig
channel
-
-
Constructor Summary
Constructors Modifier Constructor Description private
NioSocketChannelConfig(NioSocketChannel channel, java.net.Socket javaSocket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
autoReadCleared()
Is called onceDefaultChannelConfig.setAutoRead(boolean)
is called withfalse
andDefaultChannelConfig.isAutoRead()
wastrue
before.private void
calculateMaxBytesPerGatheringWrite()
(package private) int
getMaxBytesPerGatheringWrite()
<T> T
getOption(ChannelOption<T> option)
Return the value of the givenChannelOption
java.util.Map<ChannelOption<?>,java.lang.Object>
getOptions()
Return all setChannelOption
's.private java.nio.channels.SocketChannel
jdkChannel()
(package private) void
setMaxBytesPerGatheringWrite(int maxBytesPerGatheringWrite)
<T> boolean
setOption(ChannelOption<T> option, T value)
Sets a configuration property with the specified name and value.NioSocketChannel.NioSocketChannelConfig
setSendBufferSize(int sendBufferSize)
Sets theStandardSocketOptions.SO_SNDBUF
option.-
Methods inherited from class io.netty.channel.socket.DefaultSocketChannelConfig
getReceiveBufferSize, getSendBufferSize, getSoLinger, getTrafficClass, isAllowHalfClosure, isKeepAlive, isReuseAddress, isTcpNoDelay, setAllocator, setAllowHalfClosure, setAutoClose, setAutoRead, setConnectTimeoutMillis, setKeepAlive, setMaxMessagesPerRead, setMessageSizeEstimator, setPerformancePreferences, setReceiveBufferSize, setRecvByteBufAllocator, setReuseAddress, setSoLinger, setTcpNoDelay, setTrafficClass, setWriteBufferHighWaterMark, setWriteBufferLowWaterMark, setWriteBufferWaterMark, setWriteSpinCount
-
Methods inherited from class io.netty.channel.DefaultChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMaxMessagesPerWrite, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setMaxMessagesPerWrite, setOptions, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.channel.ChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions
-
-
-
-
Constructor Detail
-
NioSocketChannelConfig
private NioSocketChannelConfig(NioSocketChannel channel, java.net.Socket javaSocket)
-
-
Method Detail
-
autoReadCleared
protected void autoReadCleared()
Description copied from class:DefaultChannelConfig
Is called onceDefaultChannelConfig.setAutoRead(boolean)
is called withfalse
andDefaultChannelConfig.isAutoRead()
wastrue
before.- Overrides:
autoReadCleared
in classDefaultChannelConfig
-
setSendBufferSize
public NioSocketChannel.NioSocketChannelConfig setSendBufferSize(int sendBufferSize)
Description copied from interface:SocketChannelConfig
Sets theStandardSocketOptions.SO_SNDBUF
option.- Specified by:
setSendBufferSize
in interfaceSocketChannelConfig
- Overrides:
setSendBufferSize
in classDefaultSocketChannelConfig
-
setOption
public <T> boolean setOption(ChannelOption<T> option, T value)
Description copied from interface:ChannelConfig
Sets a configuration property with the specified name and value. To override this method properly, you must call the super class:public boolean setOption(ChannelOption<T> option, T value) { if (super.setOption(option, value)) { return true; } if (option.equals(additionalOption)) { .... return true; } return false; }
- Specified by:
setOption
in interfaceChannelConfig
- Overrides:
setOption
in classDefaultSocketChannelConfig
- Returns:
true
if and only if the property has been set
-
getOption
public <T> T getOption(ChannelOption<T> option)
Description copied from interface:ChannelConfig
Return the value of the givenChannelOption
- Specified by:
getOption
in interfaceChannelConfig
- Overrides:
getOption
in classDefaultSocketChannelConfig
-
getOptions
public java.util.Map<ChannelOption<?>,java.lang.Object> getOptions()
Description copied from interface:ChannelConfig
Return all setChannelOption
's.- Specified by:
getOptions
in interfaceChannelConfig
- Overrides:
getOptions
in classDefaultSocketChannelConfig
-
setMaxBytesPerGatheringWrite
void setMaxBytesPerGatheringWrite(int maxBytesPerGatheringWrite)
-
getMaxBytesPerGatheringWrite
int getMaxBytesPerGatheringWrite()
-
calculateMaxBytesPerGatheringWrite
private void calculateMaxBytesPerGatheringWrite()
-
jdkChannel
private java.nio.channels.SocketChannel jdkChannel()
-
-