Channel.
Please down-cast to more specific configuration type such as
SocketChannelConfig or use setOptions(Map) to set the
transport-specific properties:
Channelch = ...;SocketChannelConfigcfg = (SocketChannelConfig) ch.getConfig(); cfg.setTcpNoDelay(false);
Channel without down-casting its associated
ChannelConfig. To update an option map, please call setOptions(Map).
All ChannelConfig has the following options:
More options are available in the sub-types of ChannelConfig. For
example, you can configure the parameters which are specific to a TCP/IP
socket as explained in SocketChannelConfig.
| Modifier and Type | Method and Description |
|---|---|
| public ByteBufAllocator | |
| public int | Returns: the connect timeout in milliseconds.0 if disabled.Returns the connect timeout of the channel in milliseconds. |
| public int | |
| public MessageSizeEstimator | getMessageSizeEstimator()
Returns |
| public <T> T | |
| public Map | |
| public <T extends RecvByteBufAllocator> T | getRecvByteBufAllocator()
Returns |
| public int | |
| public int | |
| public WriteBufferWaterMark | getWriteBufferWaterMark()
Returns the |
| public int | getWriteSpinCount()
Returns the maximum loop count for a write operation until
|
| public boolean | isAutoClose()
Returns |
| public boolean | isAutoRead()
Returns |
| public ChannelConfig | setAllocator(ByteBufAllocator allocator)
Set the |
| public ChannelConfig | setAutoClose(boolean autoClose)
Sets whether the |
| public ChannelConfig | setAutoRead(boolean autoRead)
Sets if |
| public ChannelConfig | setConnectTimeoutMillis(int
the connect timeout in milliseconds.
connectTimeoutMillis)0 to disable.Sets the connect timeout of the channel in milliseconds. |
| public ChannelConfig | setMaxMessagesPerRead(int maxMessagesPerRead)
|
| public ChannelConfig | setMessageSizeEstimator(MessageSizeEstimator estimator)
Set the |
| public <T> boolean | Returns: true if and only if the property has been setSets a configuration property with the specified name and value. |
| public boolean | setOptions(Map<ChannelOption<?>, ?> options)
Sets the configuration properties from the specified |
| public ChannelConfig | setRecvByteBufAllocator(RecvByteBufAllocator allocator)
Set the |
| public ChannelConfig | setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Sets the high water mark of the write buffer. |
| public ChannelConfig | setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Sets the low water mark of the write buffer. |
| public ChannelConfig | setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
Set the |
| public ChannelConfig | setWriteSpinCount(int writeSpinCount)
Sets the maximum loop count for a write operation until
|
| getAllocator | back to summary |
|---|---|
| public ByteBufAllocator getAllocator() Returns | |
| getConnectTimeoutMillis | back to summary |
|---|---|
| public int getConnectTimeoutMillis() Returns the connect timeout of the channel in milliseconds. If the
| |
| getMaxMessagesPerRead | back to summary |
|---|---|
| public int getMaxMessagesPerRead()
Deprecated Use
Returns the maximum number of messages to read per read loop.
a
| |
| getMessageSizeEstimator | back to summary |
|---|---|
| public MessageSizeEstimator getMessageSizeEstimator() Returns | |
| getOption | back to summary |
|---|---|
| public <T> T getOption(ChannelOption<T> option) Return the value of the given | |
| getOptions | back to summary |
|---|---|
| public Map Return all set | |
| getRecvByteBufAllocator | back to summary |
|---|---|
| public <T extends RecvByteBufAllocator> T getRecvByteBufAllocator() Returns | |
| getWriteBufferHighWaterMark | back to summary |
|---|---|
| public int getWriteBufferHighWaterMark() Returns the high water mark of the write buffer. If the number of bytes
queued in the write buffer exceeds this value, | |
| getWriteBufferLowWaterMark | back to summary |
|---|---|
| public int getWriteBufferLowWaterMark() Returns the low water mark of the write buffer. Once the number of bytes
queued in the write buffer exceeded the
high water mark and then
dropped down below this value, | |
| getWriteBufferWaterMark | back to summary |
|---|---|
| public WriteBufferWaterMark getWriteBufferWaterMark() Returns the | |
| getWriteSpinCount | back to summary |
|---|---|
| public int getWriteSpinCount() Returns the maximum loop count for a write operation until
| |
| isAutoClose | back to summary |
|---|---|
| public boolean isAutoClose() Returns | |
| isAutoRead | back to summary |
|---|---|
| public boolean isAutoRead() Returns | |
| setAllocator | back to summary |
|---|---|
| public ChannelConfig setAllocator(ByteBufAllocator allocator) Set the | |
| setAutoClose | back to summary |
|---|---|
| public ChannelConfig setAutoClose(boolean autoClose) Sets whether the | |
| setAutoRead | back to summary |
|---|---|
| public ChannelConfig setAutoRead(boolean autoRead) Sets if | |
| setConnectTimeoutMillis | back to summary |
|---|---|
| public ChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis) Sets the connect timeout of the channel in milliseconds. If the
| |
| setMaxMessagesPerRead | back to summary |
|---|---|
| public ChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated Use Sets the maximum number of messages to read per read loop. If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages.
| |
| setMessageSizeEstimator | back to summary |
|---|---|
| public ChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) Set the | |
| setOption | back to summary |
|---|---|
| public <T> boolean setOption(ChannelOption<T> option, T value) 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;
}
| |
| setOptions | back to summary |
|---|---|
| public boolean setOptions(Map<ChannelOption<?>, ?> options) Sets the configuration properties from the specified | |
| setRecvByteBufAllocator | back to summary |
|---|---|
| public ChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator) Set the | |
| setWriteBufferHighWaterMark | back to summary |
|---|---|
| public ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Sets the high water mark of the write buffer. If the number of bytes
queued in the write buffer exceeds this value, | |
| setWriteBufferLowWaterMark | back to summary |
|---|---|
| public ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Sets the low water mark of the write buffer. Once the number of bytes
queued in the write buffer exceeded the
high water mark and then
dropped down below this value, | |
| setWriteBufferWaterMark | back to summary |
|---|---|
| public ChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) Set the | |
| setWriteSpinCount | back to summary |
|---|---|
| public ChannelConfig setWriteSpinCount(int writeSpinCount) Sets the maximum loop count for a write operation until
| |