public class DefaultUdtChannelConfig extends DefaultChannelConfig implements UdtChannelConfig
UdtChannelConfig implementation.channel| Constructor and Description |
|---|
DefaultUdtChannelConfig(UdtChannel channel,
com.barchart.udt.nio.ChannelUDT channelUDT,
boolean apply) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
apply(com.barchart.udt.nio.ChannelUDT channelUDT) |
<T> T |
getOption(ChannelOption<T> option)
Return the value of the given
ChannelOption |
Map<ChannelOption<?>,Object> |
getOptions()
Return all set
ChannelOption's. |
int |
getProtocolReceiveBufferSize()
Gets
OptionUDT.Protocol_Receive_Buffer_Size |
int |
getProtocolSendBufferSize()
Gets
OptionUDT.Protocol_Send_Buffer_Size |
int |
getReceiveBufferSize()
Gets the
ChannelOption.SO_RCVBUF option. |
int |
getSendBufferSize()
Gets the
ChannelOption.SO_SNDBUF option. |
int |
getSoLinger()
Gets the
ChannelOption.SO_LINGER option. |
int |
getSystemReceiveBufferSize()
Gets
OptionUDT.System_Receive_Buffer_Size |
int |
getSystemSendBufferSize()
Gets
OptionUDT.System_Send_Buffer_Size |
boolean |
isReuseAddress()
Gets the
ChannelOption.SO_REUSEADDR option. |
UdtChannelConfig |
setAllocator(ByteBufAllocator allocator)
Set the
ByteBufAllocator which is used for the channel
to allocate buffers. |
UdtChannelConfig |
setAutoRead(boolean autoRead)
Sets if
ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't
need to call it at all. |
UdtChannelConfig |
setConnectTimeoutMillis(int connectTimeoutMillis)
Sets the connect timeout of the channel in milliseconds.
|
UdtChannelConfig |
setMaxMessagesPerRead(int maxMessagesPerRead)
Sets the maximum number of messages to read per read loop.
|
UdtChannelConfig |
setMessageSizeEstimator(MessageSizeEstimator estimator)
Set the
ByteBufAllocator which is used for the channel
to detect the size of a message. |
<T> boolean |
setOption(ChannelOption<T> option,
T value)
Sets a configuration property with the specified name and value.
|
UdtChannelConfig |
setProtocolReceiveBufferSize(int protocolReceiveBufferSize)
Sets
OptionUDT.Protocol_Receive_Buffer_Size |
UdtChannelConfig |
setProtocolSendBufferSize(int protocolSendBufferSize)
Sets
OptionUDT.Protocol_Send_Buffer_Size |
UdtChannelConfig |
setReceiveBufferSize(int receiveBufferSize)
Sets the
ChannelOption.SO_RCVBUF option. |
UdtChannelConfig |
setRecvByteBufAllocator(RecvByteBufAllocator allocator)
Set the
ByteBufAllocator which is used for the channel
to allocate receive buffers. |
UdtChannelConfig |
setReuseAddress(boolean reuseAddress)
Sets the
ChannelOption.SO_REUSEADDR option. |
UdtChannelConfig |
setSendBufferSize(int sendBufferSize)
Sets the
ChannelOption.SO_SNDBUF option. |
UdtChannelConfig |
setSoLinger(int soLinger)
Sets the
ChannelOption.SO_LINGER option. |
UdtChannelConfig |
setSystemReceiveBufferSize(int systemSendBufferSize)
Sets
OptionUDT.System_Receive_Buffer_Size |
UdtChannelConfig |
setSystemSendBufferSize(int systemReceiveBufferSize)
Sets
OptionUDT.System_Send_Buffer_Size |
UdtChannelConfig |
setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Sets the high water mark of the write buffer.
|
UdtChannelConfig |
setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Sets the low water mark of the write buffer.
|
UdtChannelConfig |
setWriteSpinCount(int writeSpinCount)
Sets the maximum loop count for a write operation until
WritableByteChannel.write(ByteBuffer) returns a non-zero value. |
autoReadCleared, getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteSpinCount, isAutoRead, setOptions, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteSpinCount, isAutoRead, setOptionspublic DefaultUdtChannelConfig(UdtChannel channel, com.barchart.udt.nio.ChannelUDT channelUDT, boolean apply) throws IOException
IOExceptionprotected void apply(com.barchart.udt.nio.ChannelUDT channelUDT)
throws IOException
IOExceptionpublic int getProtocolReceiveBufferSize()
UdtChannelConfigOptionUDT.Protocol_Receive_Buffer_SizegetProtocolReceiveBufferSize in interface UdtChannelConfigpublic <T> T getOption(ChannelOption<T> option)
ChannelConfigChannelOptiongetOption in interface ChannelConfiggetOption in class DefaultChannelConfigpublic Map<ChannelOption<?>,Object> getOptions()
ChannelConfigChannelOption's.getOptions in interface ChannelConfiggetOptions in class DefaultChannelConfigpublic int getReceiveBufferSize()
UdtChannelConfigChannelOption.SO_RCVBUF option.getReceiveBufferSize in interface UdtChannelConfigpublic int getSendBufferSize()
UdtChannelConfigChannelOption.SO_SNDBUF option.getSendBufferSize in interface UdtChannelConfigpublic int getSoLinger()
UdtChannelConfigChannelOption.SO_LINGER option.getSoLinger in interface UdtChannelConfigpublic boolean isReuseAddress()
UdtChannelConfigChannelOption.SO_REUSEADDR option.isReuseAddress in interface UdtChannelConfigpublic UdtChannelConfig setProtocolReceiveBufferSize(int protocolReceiveBufferSize)
UdtChannelConfigOptionUDT.Protocol_Receive_Buffer_SizesetProtocolReceiveBufferSize in interface UdtChannelConfigpublic <T> boolean setOption(ChannelOption<T> option, T value)
ChannelConfig
public boolean setOption(ChannelOption<T> option, T value) {
if (super.setOption(option, value)) {
return true;
}
if (option.equals(additionalOption)) {
....
return true;
}
return false;
}
setOption in interface ChannelConfigsetOption in class DefaultChannelConfigtrue if and only if the property has been setpublic UdtChannelConfig setReceiveBufferSize(int receiveBufferSize)
UdtChannelConfigChannelOption.SO_RCVBUF option.setReceiveBufferSize in interface UdtChannelConfigpublic UdtChannelConfig setReuseAddress(boolean reuseAddress)
UdtChannelConfigChannelOption.SO_REUSEADDR option.setReuseAddress in interface UdtChannelConfigpublic UdtChannelConfig setSendBufferSize(int sendBufferSize)
UdtChannelConfigChannelOption.SO_SNDBUF option.setSendBufferSize in interface UdtChannelConfigpublic UdtChannelConfig setSoLinger(int soLinger)
UdtChannelConfigChannelOption.SO_LINGER option.setSoLinger in interface UdtChannelConfigpublic int getSystemReceiveBufferSize()
UdtChannelConfigOptionUDT.System_Receive_Buffer_SizegetSystemReceiveBufferSize in interface UdtChannelConfigpublic UdtChannelConfig setSystemSendBufferSize(int systemReceiveBufferSize)
UdtChannelConfigOptionUDT.System_Send_Buffer_SizesetSystemSendBufferSize in interface UdtChannelConfigpublic int getProtocolSendBufferSize()
UdtChannelConfigOptionUDT.Protocol_Send_Buffer_SizegetProtocolSendBufferSize in interface UdtChannelConfigpublic UdtChannelConfig setProtocolSendBufferSize(int protocolSendBufferSize)
UdtChannelConfigOptionUDT.Protocol_Send_Buffer_SizesetProtocolSendBufferSize in interface UdtChannelConfigpublic UdtChannelConfig setSystemReceiveBufferSize(int systemSendBufferSize)
UdtChannelConfigOptionUDT.System_Receive_Buffer_SizesetSystemReceiveBufferSize in interface UdtChannelConfigpublic int getSystemSendBufferSize()
UdtChannelConfigOptionUDT.System_Send_Buffer_SizegetSystemSendBufferSize in interface UdtChannelConfigpublic UdtChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
ChannelConfigChannel does not support connect operation, this property is not
used at all, and therefore will be ignored.setConnectTimeoutMillis in interface ChannelConfigsetConnectTimeoutMillis in interface UdtChannelConfigsetConnectTimeoutMillis in class DefaultChannelConfigconnectTimeoutMillis - the connect timeout in milliseconds.
0 to disable.public UdtChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
ChannelConfigsetMaxMessagesPerRead in interface ChannelConfigsetMaxMessagesPerRead in interface UdtChannelConfigsetMaxMessagesPerRead in class DefaultChannelConfigpublic UdtChannelConfig setWriteSpinCount(int writeSpinCount)
ChannelConfigWritableByteChannel.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 in interface ChannelConfigsetWriteSpinCount in interface UdtChannelConfigsetWriteSpinCount in class DefaultChannelConfigpublic UdtChannelConfig setAllocator(ByteBufAllocator allocator)
ChannelConfigByteBufAllocator which is used for the channel
to allocate buffers.setAllocator in interface ChannelConfigsetAllocator in interface UdtChannelConfigsetAllocator in class DefaultChannelConfigpublic UdtChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
ChannelConfigByteBufAllocator which is used for the channel
to allocate receive buffers.setRecvByteBufAllocator in interface ChannelConfigsetRecvByteBufAllocator in interface UdtChannelConfigsetRecvByteBufAllocator in class DefaultChannelConfigpublic UdtChannelConfig setAutoRead(boolean autoRead)
ChannelConfigChannelHandlerContext.read() will be invoked automatically so that a user application doesn't
need to call it at all. The default value is true.setAutoRead in interface ChannelConfigsetAutoRead in interface UdtChannelConfigsetAutoRead in class DefaultChannelConfigpublic UdtChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
ChannelConfigChannel.isWritable() will start to return
true again.setWriteBufferLowWaterMark in interface ChannelConfigsetWriteBufferLowWaterMark in interface UdtChannelConfigsetWriteBufferLowWaterMark in class DefaultChannelConfigpublic UdtChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
ChannelConfigChannel.isWritable()
will start to return false.setWriteBufferHighWaterMark in interface ChannelConfigsetWriteBufferHighWaterMark in interface UdtChannelConfigsetWriteBufferHighWaterMark in class DefaultChannelConfigpublic UdtChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
ChannelConfigByteBufAllocator which is used for the channel
to detect the size of a message.setMessageSizeEstimator in interface ChannelConfigsetMessageSizeEstimator in interface UdtChannelConfigsetMessageSizeEstimator in class DefaultChannelConfigCopyright © 2008–2015 The Netty Project. All rights reserved.