GeezerVison is showing netty.io — DefaultChannelConfig (Netty API Reference (4.1.141.Final))
Class DefaultChannelConfig
-
Field Summary
Fields
Modifier and Type
Field
Description
-
Constructor Summary
Constructors
Modifier
Constructor
Description
protected
-
Method Summary
Modifier and Type
Method
Description
protected void
int
Returns the connect timeout of the channel in milliseconds.
int
int
Get the maximum number of message to write per eventloop run.
<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.
Set the maximum number of message to write per eventloop run.
<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.
protected <T> void
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Details
-
DefaultChannelConfig
public DefaultChannelConfig(Channel channel)
-
-
Method Details
-
-
-
-
-
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;
}
- Specified by:
setOption in interface ChannelConfig
- Returns:
true if and only if the property has been set
-
-
getConnectTimeoutMillis
public 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.
- Specified by:
getConnectTimeoutMillis in interface ChannelConfig
- Returns:
- the connect timeout in milliseconds.
0 if disabled.
-
setConnectTimeoutMillis
public ChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
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.
- Specified by:
setConnectTimeoutMillis in interface ChannelConfig
- Parameters:
connectTimeoutMillis - the connect timeout in milliseconds.
0 to disable.
-
-
-
getMaxMessagesPerWrite
public int getMaxMessagesPerWrite()
Get the maximum number of message to write per eventloop run. Once this limit is
reached we will continue to process other events before trying to write the remaining messages.
-
setMaxMessagesPerWrite
public ChannelConfig setMaxMessagesPerWrite(int maxMessagesPerWrite)
Set the maximum number of message to write per eventloop run. Once this limit is
reached we will continue to process other events before trying to write the remaining messages.
-
getWriteSpinCount
public 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.
- Specified by:
getWriteSpinCount in interface ChannelConfig
-
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.
- Specified by:
setWriteSpinCount in interface ChannelConfig
-
-
-
-
-
-
-
autoReadCleared
protected void autoReadCleared()
-
isAutoClose
public boolean isAutoClose()
Returns true if and only if the Channel will be closed automatically and immediately on
write failure. The default is true.
- Specified by:
isAutoClose in interface ChannelConfig
-
setAutoClose
Sets whether the Channel should be closed automatically and immediately on write failure.
The default is true.
- Specified by:
setAutoClose in interface ChannelConfig
-
getWriteBufferHighWaterMark
-
setWriteBufferHighWaterMark
-
getWriteBufferLowWaterMark
-
setWriteBufferLowWaterMark
-
-
-
-
|