GeezerVison is showing netty.io — ChannelConfig (Netty API Reference (4.1.141.Final))
Interface ChannelConfig
- All Known Subinterfaces:
DatagramChannelConfig, DomainDatagramChannelConfig, DomainSocketChannelConfig, DuplexChannelConfig, OioDatagramChannelConfig, OioServerSocketChannelConfig, OioSocketChannelConfig, RxtxChannelConfig, SctpChannelConfig, SctpServerChannelConfig, ServerSocketChannelConfig, SocketChannelConfig, UdtChannelConfig, UdtServerChannelConfig
- All Known Implementing Classes:
DefaultChannelConfig, DefaultDatagramChannelConfig, DefaultOioServerSocketChannelConfig, DefaultOioSocketChannelConfig, DefaultSctpChannelConfig, DefaultSctpServerChannelConfig, DefaultServerSocketChannelConfig, DefaultSocketChannelConfig, DefaultUdtChannelConfig, DefaultUdtServerChannelConfig, EpollChannelConfig, EpollDatagramChannelConfig, EpollDomainDatagramChannelConfig, EpollDomainSocketChannelConfig, EpollServerChannelConfig, EpollServerSocketChannelConfig, EpollSocketChannelConfig, KQueueChannelConfig, KQueueDatagramChannelConfig, KQueueDomainDatagramChannelConfig, KQueueDomainSocketChannelConfig, KQueueServerChannelConfig, KQueueServerSocketChannelConfig, KQueueSocketChannelConfig
public interface ChannelConfig
-
Method Summary
Modifier and Type
Method
Description
int
Returns the connect timeout of the channel in milliseconds.
int
<T> T
int
Returns the high water mark of the write buffer.
int
Returns the low water mark of the write buffer.
Returns the WriteBufferWaterMark which is used for setting the high and low
water mark of the write buffer.
int
boolean
Returns true if and only if the Channel will be closed automatically and immediately on
write failure.
boolean
Returns true if and only if ChannelHandlerContext.read() will be invoked automatically so that
a user application doesn't need to call it at all.
Sets whether the Channel should be closed automatically and immediately on write failure.
Sets the connect timeout of the channel in milliseconds.
<T> boolean
Sets a configuration property with the specified name and value.
boolean
Sets the configuration properties from the specified Map.
Sets the high water mark of the write buffer.
Sets the low water mark of the write buffer.
Set the WriteBufferWaterMark which is used for setting the high and low
water mark of the write buffer.
-
Method Details
-
-
setOptions
Sets the configuration properties from the specified Map.
-
-
setOption
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;
}
- Returns:
true if and only if the property has been set
-
getConnectTimeoutMillis
int getConnectTimeoutMillis()
Returns the connect timeout of the channel in milliseconds. If the
Channel does not support connect operation, this property is not
used at all, and therefore will be ignored.
- Returns:
- the connect timeout in milliseconds.
0 if disabled.
-
setConnectTimeoutMillis
Sets the connect timeout of the channel in milliseconds. If the
Channel does not support connect operation, this property is not
used at all, and therefore will be ignored.
- Parameters:
connectTimeoutMillis - the connect timeout in milliseconds.
0 to disable.
-
-
-
getWriteSpinCount
int getWriteSpinCount()
Returns the maximum loop count for a write operation until
WritableByteChannel.write(ByteBuffer) returns a non-zero value.
It is similar to what a spin lock is used for in concurrency programming.
It improves memory utilization and write throughput depending on
the platform that JVM runs on. The default value is 16.
-
setWriteSpinCount
Sets the maximum loop count for a write operation until
WritableByteChannel.write(ByteBuffer) returns a non-zero value.
It is similar to what a spin lock is used for in concurrency programming.
It improves memory utilization and write throughput depending on
the platform that JVM runs on. The default value is 16.
- Throws:
IllegalArgumentException - if the specified value is 0 or less than 0
-
-
-
-
-
isAutoRead
boolean isAutoRead()
Returns true if and only if ChannelHandlerContext.read() will be invoked automatically so that
a user application doesn't need to call it at all. The default value is true.
-
setAutoRead
Sets if ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't
need to call it at all. The default value is true.
-
isAutoClose
boolean isAutoClose()
Returns true if and only if the Channel will be closed automatically and immediately on
write failure. The default is true.
-
setAutoClose
Sets whether the Channel should be closed automatically and immediately on write failure.
The default is true.
-
getWriteBufferHighWaterMark
int getWriteBufferHighWaterMark()
Returns the high water mark of the write buffer. If the number of bytes
queued in the write buffer exceeds this value, Channel.isWritable()
will start to return false.
-
setWriteBufferHighWaterMark
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, Channel.isWritable()
will start to return false.
-
getWriteBufferLowWaterMark
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, Channel.isWritable() will start to return
true again.
-
setWriteBufferLowWaterMark
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, Channel.isWritable() will start to return
true again.
-
-
-
getWriteBufferWaterMark
Returns the WriteBufferWaterMark which is used for setting the high and low
water mark of the write buffer.
-
setWriteBufferWaterMark
Set the WriteBufferWaterMark which is used for setting the high and low
water mark of the write buffer.
|