allowed low water mark to be same with high water mark

This commit is contained in:
Trustin Lee 2008-11-28 06:57:29 +00:00
parent 4e7852e29e
commit 3e09a4ee60
2 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,7 @@ class DefaultNioSocketChannelConfig extends DefaultSocketChannelConfig
InternalLoggerFactory.getInstance(DefaultNioSocketChannelConfig.class);
private volatile int writeBufferHighWaterMark = 256 * 1024;
private volatile int writeBufferLowWaterMark = 64 * 1024;
private volatile int writeBufferLowWaterMark = 128 * 1024;
private volatile ReceiveBufferSizePredictor predictor =
new DefaultReceiveBufferSizePredictor();
private volatile int writeSpinCount = 16;

View File

@ -171,7 +171,8 @@ abstract class NioSocketChannel extends AbstractChannel
if (e != null) {
int newWriteBufferSize = writeBufferSize.addAndGet(
-((ChannelBuffer) e.getMessage()).readableBytes());
if (newWriteBufferSize <= getConfig().getWriteBufferLowWaterMark()) {
if (newWriteBufferSize == 0 ||
newWriteBufferSize < getConfig().getWriteBufferLowWaterMark()) {
exceededHighWaterMark = true;
}
}