[#3806] Setting WRITE_BUFFER_LOW_WATER_MARK before WRITE_BUFFER_HIGH_WATER_MARK results in an internal Exception
Motivation: Setting the WRITE_BUFFER_LOW_WATER_MARK before WRITE_BUFFER_HIGH_WATER_MARK results in an internal Exception (appears only in the logs) if the value is larger than the default high water mark value. The WRITE_BUFFER_HIGH_WATER_MARK call appears to have no effect in this context. Setting the values in the reverse order works. Modifications: - deprecated ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK and ChannelOption.WRITE_BUFFER_LOW_WATER_MARK. - add one new option called ChannelOption.WRITE_BUFFER_WATER_MARK. Result: The high/low water mark values limits caused by default values are removed. Setting the WRITE_BUFFER_LOW_WATER_MARK before WRITE_BUFFER_HIGH_WATER_MARK results in an internal Exception (appears only in the logs) if the value is larger than the default high water mark value. The WRITE_BUFFER_HIGH_WATER_MARK call appears to have no effect in this context. Setting the values in the reverse order works.
This commit is contained in:
parent
9d4fae308c
commit
3e5dcb5f3e
@ -21,6 +21,7 @@ import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.DefaultChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@ -96,17 +97,25 @@ public class EpollChannelConfig extends DefaultChannelConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.FixedRecvByteBufAllocator;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.channel.socket.DatagramChannelConfig;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -138,17 +139,25 @@ public final class EpollDatagramChannelConfig extends EpollChannelConfig impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollDatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollDatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollDatagramChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollDatagramChannelConfig setAutoClose(boolean autoClose) {
|
||||
super.setAutoClose(autoClose);
|
||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.channel.unix.DomainSocketChannelConfig;
|
||||
import io.netty.channel.unix.DomainSocketReadMode;
|
||||
|
||||
@ -103,17 +104,25 @@ public final class EpollDomainSocketChannelConfig extends EpollChannelConfig
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollDomainSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollDomainSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollDomainSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollDomainSocketChannelConfig setAutoRead(boolean autoRead) {
|
||||
super.setAutoRead(autoRead);
|
||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelException;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.util.NetUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -191,17 +192,25 @@ public class EpollServerChannelConfig extends EpollChannelConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelException;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.channel.socket.ServerSocketChannelConfig;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -141,17 +142,25 @@ public final class EpollServerSocketChannelConfig extends EpollServerChannelConf
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelException;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.channel.socket.SocketChannelConfig;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
|
||||
@ -528,17 +529,25 @@ public final class EpollSocketChannelConfig extends EpollChannelConfig implement
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public EpollSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EpollSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.channel.ChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
/**
|
||||
* Special {@link ChannelConfig} for {@link DomainSocketChannel}s.
|
||||
@ -48,11 +49,16 @@ public interface DomainSocketChannelConfig extends ChannelConfig {
|
||||
DomainSocketChannelConfig setAutoClose(boolean autoClose);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
DomainSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
DomainSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
@Override
|
||||
DomainSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
@Override
|
||||
DomainSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
|
||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.DefaultChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -249,17 +250,25 @@ final class DefaultRxtxChannelConfig extends DefaultChannelConfig implements Rxt
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public RxtxChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public RxtxChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RxtxChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RxtxChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -20,6 +20,7 @@ import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.channel.ChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
/**
|
||||
* A configuration class for RXTX device connections.
|
||||
@ -293,11 +294,16 @@ public interface RxtxChannelConfig extends ChannelConfig {
|
||||
RxtxChannelConfig setAutoClose(boolean autoClose);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
RxtxChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
RxtxChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
@Override
|
||||
RxtxChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
@Override
|
||||
RxtxChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.DefaultChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -218,17 +219,25 @@ public class DefaultSctpChannelConfig extends DefaultChannelConfig implements Sc
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public SctpChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public SctpChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -24,6 +24,7 @@ import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.DefaultChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.util.NetUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -200,17 +201,25 @@ public class DefaultSctpServerChannelConfig extends DefaultChannelConfig impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public SctpServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public SctpServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelConfig;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
/**
|
||||
* A {@link ChannelConfig} for a {@link SctpChannel}.
|
||||
@ -121,11 +122,16 @@ public interface SctpChannelConfig extends ChannelConfig {
|
||||
SctpChannelConfig setAutoClose(boolean autoClose);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
SctpChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
SctpChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
@Override
|
||||
SctpChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
@Override
|
||||
SctpChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelConfig;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
/**
|
||||
* A {@link ChannelConfig} for a {@link SctpServerChannelConfig}.
|
||||
@ -116,11 +117,16 @@ public interface SctpServerChannelConfig extends ChannelConfig {
|
||||
SctpServerChannelConfig setAutoClose(boolean autoClose);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
SctpServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
SctpServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
@Override
|
||||
SctpServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
@Override
|
||||
SctpServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.DefaultChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@ -284,17 +285,25 @@ public class DefaultUdtChannelConfig extends DefaultChannelConfig implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public UdtChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public UdtChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdtChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdtChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -20,6 +20,7 @@ import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
@ -180,17 +181,25 @@ public class DefaultUdtServerChannelConfig extends DefaultUdtChannelConfig
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public UdtServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public UdtServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdtServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UdtServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -23,6 +23,7 @@ import io.netty.channel.ChannelException;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
/**
|
||||
* A {@link ChannelConfig} for a {@link UdtChannel}.
|
||||
@ -135,11 +136,16 @@ public interface UdtChannelConfig extends ChannelConfig {
|
||||
UdtChannelConfig setAutoClose(boolean autoClose);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
UdtChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
UdtChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
@Override
|
||||
UdtChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
@Override
|
||||
UdtChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
|
||||
|
@ -23,6 +23,7 @@ import io.netty.channel.ChannelException;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
/**
|
||||
* A {@link ChannelConfig} for a {@link UdtServerChannel}.
|
||||
@ -93,11 +94,16 @@ public interface UdtServerChannelConfig extends UdtChannelConfig {
|
||||
UdtServerChannelConfig setSystemSendBufferSize(int size);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
UdtServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
UdtServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
@Override
|
||||
UdtServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
@Override
|
||||
UdtServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
}
|
||||
|
@ -50,6 +50,8 @@ import java.util.Map;
|
||||
* </tr><tr>
|
||||
* <td>{@link ChannelOption#WRITE_SPIN_COUNT}</td><td>{@link #setWriteSpinCount(int)}</td>
|
||||
* </tr><tr>
|
||||
* <td>{@link ChannelOption#WRITE_BUFFER_WATER_MARK}</td><td>{@link #setWriteBufferWaterMark(WriteBufferWaterMark)}</td>
|
||||
* </tr><tr>
|
||||
* <td>{@link ChannelOption#ALLOCATOR}</td><td>{@link #setAllocator(ByteBufAllocator)}</td>
|
||||
* </tr><tr>
|
||||
* <td>{@link ChannelOption#AUTO_READ}</td><td>{@link #setAutoRead(boolean)}</td>
|
||||
@ -218,10 +220,13 @@ public interface ChannelConfig {
|
||||
int getWriteBufferHighWaterMark();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setWriteBufferWaterMark(WriteBufferWaterMark)}
|
||||
* <p>
|
||||
* Sets the high water mark of the write buffer. If the number of bytes
|
||||
* queued in the write buffer exceeds this value, {@link Channel#isWritable()}
|
||||
* will start to return {@code false}.
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
/**
|
||||
@ -234,12 +239,15 @@ public interface ChannelConfig {
|
||||
int getWriteBufferLowWaterMark();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setWriteBufferWaterMark(WriteBufferWaterMark)}
|
||||
* <p>
|
||||
* Sets the low water mark of the write buffer. Once the number of bytes
|
||||
* queued in the write buffer exceeded the
|
||||
* {@linkplain #setWriteBufferHighWaterMark(int) high water mark} and then
|
||||
* dropped down below this value, {@link Channel#isWritable()} will start to return
|
||||
* {@code true} again.
|
||||
*/
|
||||
@Deprecated
|
||||
ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
/**
|
||||
@ -253,4 +261,16 @@ public interface ChannelConfig {
|
||||
* to detect the size of a message.
|
||||
*/
|
||||
ChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
|
||||
/**
|
||||
* Returns the {@link WriteBufferWaterMark} which is used for setting the high and low
|
||||
* water mark of the write buffer.
|
||||
*/
|
||||
WriteBufferWaterMark getWriteBufferWaterMark();
|
||||
|
||||
/**
|
||||
* Set the {@link WriteBufferWaterMark} which is used for setting the high and low
|
||||
* water mark of the write buffer.
|
||||
*/
|
||||
ChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
}
|
||||
|
@ -81,8 +81,18 @@ public class ChannelOption<T> extends AbstractConstant<ChannelOption<T>> {
|
||||
*/
|
||||
public static final ChannelOption<Integer> MAX_MESSAGES_PER_READ = valueOf("MAX_MESSAGES_PER_READ");
|
||||
public static final ChannelOption<Integer> WRITE_SPIN_COUNT = valueOf("WRITE_SPIN_COUNT");
|
||||
/**
|
||||
* @deprecated Use {@link #WRITE_BUFFER_WATER_MARK}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ChannelOption<Integer> WRITE_BUFFER_HIGH_WATER_MARK = valueOf("WRITE_BUFFER_HIGH_WATER_MARK");
|
||||
/**
|
||||
* @deprecated Use {@link #WRITE_BUFFER_WATER_MARK}
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ChannelOption<Integer> WRITE_BUFFER_LOW_WATER_MARK = valueOf("WRITE_BUFFER_LOW_WATER_MARK");
|
||||
public static final ChannelOption<WriteBufferWaterMark> WRITE_BUFFER_WATER_MARK =
|
||||
valueOf("WRITE_BUFFER_WATER_MARK");
|
||||
|
||||
public static final ChannelOption<Boolean> ALLOW_HALF_CLOSURE = valueOf("ALLOW_HALF_CLOSURE");
|
||||
public static final ChannelOption<Boolean> AUTO_READ = valueOf("AUTO_READ");
|
||||
|
@ -16,13 +16,13 @@
|
||||
package io.netty.channel;
|
||||
|
||||
import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.channel.socket.SocketChannelConfig;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
|
||||
import static io.netty.channel.ChannelOption.ALLOCATOR;
|
||||
import static io.netty.channel.ChannelOption.AUTO_CLOSE;
|
||||
@ -33,11 +33,12 @@ import static io.netty.channel.ChannelOption.MESSAGE_SIZE_ESTIMATOR;
|
||||
import static io.netty.channel.ChannelOption.RCVBUF_ALLOCATOR;
|
||||
import static io.netty.channel.ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK;
|
||||
import static io.netty.channel.ChannelOption.WRITE_BUFFER_LOW_WATER_MARK;
|
||||
import static io.netty.channel.ChannelOption.WRITE_BUFFER_WATER_MARK;
|
||||
import static io.netty.channel.ChannelOption.WRITE_SPIN_COUNT;
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
/**
|
||||
* The default {@link SocketChannelConfig} implementation.
|
||||
* The default {@link ChannelConfig} implementation.
|
||||
*/
|
||||
public class DefaultChannelConfig implements ChannelConfig {
|
||||
private static final MessageSizeEstimator DEFAULT_MSG_SIZE_ESTIMATOR = DefaultMessageSizeEstimator.DEFAULT;
|
||||
@ -45,6 +46,7 @@ public class DefaultChannelConfig implements ChannelConfig {
|
||||
private static final int DEFAULT_CONNECT_TIMEOUT = 30000;
|
||||
|
||||
private static final AtomicIntegerFieldUpdater<DefaultChannelConfig> AUTOREAD_UPDATER;
|
||||
private static final AtomicReferenceFieldUpdater<DefaultChannelConfig, WriteBufferWaterMark> WATERMARK_UPDATER;
|
||||
|
||||
static {
|
||||
AtomicIntegerFieldUpdater<DefaultChannelConfig> autoReadUpdater =
|
||||
@ -53,6 +55,14 @@ public class DefaultChannelConfig implements ChannelConfig {
|
||||
autoReadUpdater = AtomicIntegerFieldUpdater.newUpdater(DefaultChannelConfig.class, "autoRead");
|
||||
}
|
||||
AUTOREAD_UPDATER = autoReadUpdater;
|
||||
|
||||
AtomicReferenceFieldUpdater<DefaultChannelConfig, WriteBufferWaterMark> watermarkUpdater =
|
||||
PlatformDependent.newAtomicReferenceFieldUpdater(DefaultChannelConfig.class, "writeBufferWaterMark");
|
||||
if (watermarkUpdater == null) {
|
||||
watermarkUpdater = AtomicReferenceFieldUpdater.newUpdater(
|
||||
DefaultChannelConfig.class, WriteBufferWaterMark.class, "writeBufferWaterMark");
|
||||
}
|
||||
WATERMARK_UPDATER = watermarkUpdater;
|
||||
}
|
||||
|
||||
protected final Channel channel;
|
||||
@ -66,8 +76,7 @@ public class DefaultChannelConfig implements ChannelConfig {
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
private volatile int autoRead = 1;
|
||||
private volatile boolean autoClose = true;
|
||||
private volatile int writeBufferHighWaterMark = 64 * 1024;
|
||||
private volatile int writeBufferLowWaterMark = 32 * 1024;
|
||||
private volatile WriteBufferWaterMark writeBufferWaterMark = WriteBufferWaterMark.DEFAULT;
|
||||
|
||||
public DefaultChannelConfig(Channel channel) {
|
||||
this(channel, new AdaptiveRecvByteBufAllocator());
|
||||
@ -85,7 +94,7 @@ public class DefaultChannelConfig implements ChannelConfig {
|
||||
null,
|
||||
CONNECT_TIMEOUT_MILLIS, MAX_MESSAGES_PER_READ, WRITE_SPIN_COUNT,
|
||||
ALLOCATOR, AUTO_READ, AUTO_CLOSE, RCVBUF_ALLOCATOR, WRITE_BUFFER_HIGH_WATER_MARK,
|
||||
WRITE_BUFFER_LOW_WATER_MARK, MESSAGE_SIZE_ESTIMATOR);
|
||||
WRITE_BUFFER_LOW_WATER_MARK, WRITE_BUFFER_WATER_MARK, MESSAGE_SIZE_ESTIMATOR);
|
||||
}
|
||||
|
||||
protected Map<ChannelOption<?>, Object> getOptions(
|
||||
@ -150,6 +159,9 @@ public class DefaultChannelConfig implements ChannelConfig {
|
||||
if (option == WRITE_BUFFER_LOW_WATER_MARK) {
|
||||
return (T) Integer.valueOf(getWriteBufferLowWaterMark());
|
||||
}
|
||||
if (option == WRITE_BUFFER_WATER_MARK) {
|
||||
return (T) getWriteBufferWaterMark();
|
||||
}
|
||||
if (option == MESSAGE_SIZE_ESTIMATOR) {
|
||||
return (T) getMessageSizeEstimator();
|
||||
}
|
||||
@ -179,6 +191,8 @@ public class DefaultChannelConfig implements ChannelConfig {
|
||||
setWriteBufferHighWaterMark((Integer) value);
|
||||
} else if (option == WRITE_BUFFER_LOW_WATER_MARK) {
|
||||
setWriteBufferLowWaterMark((Integer) value);
|
||||
} else if (option == WRITE_BUFFER_WATER_MARK) {
|
||||
setWriteBufferWaterMark((WriteBufferWaterMark) value);
|
||||
} else if (option == MESSAGE_SIZE_ESTIMATOR) {
|
||||
setMessageSizeEstimator((MessageSizeEstimator) value);
|
||||
} else {
|
||||
@ -337,47 +351,72 @@ public class DefaultChannelConfig implements ChannelConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getWriteBufferHighWaterMark() {
|
||||
return writeBufferHighWaterMark;
|
||||
return writeBufferWaterMark.high();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
if (writeBufferHighWaterMark < getWriteBufferLowWaterMark()) {
|
||||
throw new IllegalArgumentException(
|
||||
"writeBufferHighWaterMark cannot be less than " +
|
||||
"writeBufferLowWaterMark (" + getWriteBufferLowWaterMark() + "): " +
|
||||
writeBufferHighWaterMark);
|
||||
}
|
||||
if (writeBufferHighWaterMark < 0) {
|
||||
throw new IllegalArgumentException(
|
||||
"writeBufferHighWaterMark must be >= 0");
|
||||
}
|
||||
this.writeBufferHighWaterMark = writeBufferHighWaterMark;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWriteBufferLowWaterMark() {
|
||||
return writeBufferLowWaterMark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
if (writeBufferLowWaterMark > getWriteBufferHighWaterMark()) {
|
||||
throw new IllegalArgumentException(
|
||||
"writeBufferLowWaterMark cannot be greater than " +
|
||||
"writeBufferHighWaterMark (" + getWriteBufferHighWaterMark() + "): " +
|
||||
writeBufferLowWaterMark);
|
||||
for (;;) {
|
||||
WriteBufferWaterMark waterMark = writeBufferWaterMark;
|
||||
if (writeBufferHighWaterMark < waterMark.low()) {
|
||||
throw new IllegalArgumentException(
|
||||
"writeBufferHighWaterMark cannot be less than " +
|
||||
"writeBufferLowWaterMark (" + waterMark.low() + "): " +
|
||||
writeBufferHighWaterMark);
|
||||
}
|
||||
if (WATERMARK_UPDATER.compareAndSet(this, waterMark,
|
||||
new WriteBufferWaterMark(waterMark.low(), writeBufferHighWaterMark, false))) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getWriteBufferLowWaterMark() {
|
||||
return writeBufferWaterMark.low();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
if (writeBufferLowWaterMark < 0) {
|
||||
throw new IllegalArgumentException(
|
||||
"writeBufferLowWaterMark must be >= 0");
|
||||
}
|
||||
this.writeBufferLowWaterMark = writeBufferLowWaterMark;
|
||||
for (;;) {
|
||||
WriteBufferWaterMark waterMark = writeBufferWaterMark;
|
||||
if (writeBufferLowWaterMark > waterMark.high()) {
|
||||
throw new IllegalArgumentException(
|
||||
"writeBufferLowWaterMark cannot be greater than " +
|
||||
"writeBufferHighWaterMark (" + waterMark.high() + "): " +
|
||||
writeBufferLowWaterMark);
|
||||
}
|
||||
if (WATERMARK_UPDATER.compareAndSet(this, waterMark,
|
||||
new WriteBufferWaterMark(writeBufferLowWaterMark, waterMark.high(), false))) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
this.writeBufferWaterMark = checkNotNull(writeBufferWaterMark, "writeBufferWaterMark");
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteBufferWaterMark getWriteBufferWaterMark() {
|
||||
return writeBufferWaterMark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageSizeEstimator getMessageSizeEstimator() {
|
||||
return msgSizeEstimator;
|
||||
|
@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright 2016 The Netty Project
|
||||
*
|
||||
* The Netty Project licenses this file to you under the Apache License,
|
||||
* version 2.0 (the "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package io.netty.channel;
|
||||
|
||||
/**
|
||||
* WriteBufferWaterMark is used to set low water mark (default value is
|
||||
* {@value #DEFAULT_LOW_WATER_MARK} bytes) and high water
|
||||
* mark (default value is {@value #DEFAULT_HIGH_WATER_MARK} bytes)
|
||||
* for write buffer.
|
||||
* <p>
|
||||
* If the number of bytes queued in the write buffer exceeds the
|
||||
* {@linkplain #high} high water mark}, {@link Channel#isWritable()}
|
||||
* will start to return {@code false}.
|
||||
* <p>
|
||||
* If the number of bytes queued in the write buffer exceeds the
|
||||
* {@linkplain #high high water mark} and then
|
||||
* dropped down below the {@linkplain #low low water mark},
|
||||
* {@link Channel#isWritable()} will start to return
|
||||
* {@code true} again.
|
||||
*/
|
||||
public final class WriteBufferWaterMark {
|
||||
|
||||
private static final int DEFAULT_LOW_WATER_MARK = 32 * 1024;
|
||||
private static final int DEFAULT_HIGH_WATER_MARK = 64 * 1024;
|
||||
|
||||
public static final WriteBufferWaterMark DEFAULT =
|
||||
new WriteBufferWaterMark(DEFAULT_LOW_WATER_MARK, DEFAULT_HIGH_WATER_MARK, false);
|
||||
|
||||
private final int low;
|
||||
private final int high;
|
||||
|
||||
/**
|
||||
* Create a new instance.
|
||||
*
|
||||
* @param low low water mark for write buffer.
|
||||
* @param high high water mark for write buffer
|
||||
*/
|
||||
public WriteBufferWaterMark(int low, int high) {
|
||||
this(low, high, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is needed to keep backward-compatibility.
|
||||
*/
|
||||
WriteBufferWaterMark(int low, int high, boolean validate) {
|
||||
if (validate) {
|
||||
if (low < 0) {
|
||||
throw new IllegalArgumentException("write buffer's low water mark must be >= 0");
|
||||
}
|
||||
if (high < low) {
|
||||
throw new IllegalArgumentException(
|
||||
"write buffer's high water mark cannot be less than " +
|
||||
" low water mark (" + low + "): " +
|
||||
high);
|
||||
}
|
||||
}
|
||||
this.low = low;
|
||||
this.high = high;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the low water mark for the write buffer.
|
||||
*/
|
||||
public int low() {
|
||||
return low;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the high water mark for the write buffer.
|
||||
*/
|
||||
public int high() {
|
||||
return high;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder(55)
|
||||
.append("WriteBufferWaterMark(low: ")
|
||||
.append(low)
|
||||
.append(", high: ")
|
||||
.append(high)
|
||||
.append(")");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelConfig;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
@ -180,4 +181,8 @@ public interface DatagramChannelConfig extends ChannelConfig {
|
||||
|
||||
@Override
|
||||
DatagramChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
|
||||
@Override
|
||||
DatagramChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import io.netty.channel.DefaultChannelConfig;
|
||||
import io.netty.channel.FixedRecvByteBufAllocator;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
import io.netty.util.internal.logging.InternalLogger;
|
||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||
@ -401,17 +402,25 @@ public class DefaultDatagramChannelConfig extends DefaultChannelConfig implement
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public DatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public DatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatagramChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatagramChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.DefaultChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.util.NetUtil;
|
||||
|
||||
import java.net.ServerSocket;
|
||||
@ -185,17 +186,25 @@ public class DefaultServerSocketChannelConfig extends DefaultChannelConfig
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.DefaultChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
|
||||
import java.net.Socket;
|
||||
@ -323,17 +324,25 @@ public class DefaultSocketChannelConfig extends DefaultChannelConfig
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public SocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public SocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.channel.ChannelConfig;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
import java.net.ServerSocket;
|
||||
import java.net.StandardSocketOptions;
|
||||
@ -105,4 +106,22 @@ public interface ServerSocketChannelConfig extends ChannelConfig {
|
||||
|
||||
@Override
|
||||
ServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setWriteBufferWaterMark(WriteBufferWaterMark)}
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
ServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setWriteBufferWaterMark(WriteBufferWaterMark)}
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
ServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
@Override
|
||||
ServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import io.netty.channel.ChannelInboundHandler;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
|
||||
import java.net.Socket;
|
||||
import java.net.StandardSocketOptions;
|
||||
@ -181,4 +182,8 @@ public interface SocketChannelConfig extends ChannelConfig {
|
||||
|
||||
@Override
|
||||
SocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
|
||||
@Override
|
||||
SocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelException;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.channel.socket.DefaultServerSocketChannelConfig;
|
||||
import io.netty.channel.socket.ServerSocketChannel;
|
||||
|
||||
@ -165,17 +166,25 @@ public class DefaultOioServerSocketChannelConfig extends DefaultServerSocketChan
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public OioServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public OioServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OioServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OioServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelException;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.channel.socket.DefaultSocketChannelConfig;
|
||||
import io.netty.channel.socket.SocketChannel;
|
||||
|
||||
@ -193,17 +194,25 @@ public class DefaultOioSocketChannelConfig extends DefaultSocketChannelConfig im
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public OioSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public OioSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OioSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OioSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||
super.setMessageSizeEstimator(estimator);
|
||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.channel.socket.ServerSocketChannelConfig;
|
||||
|
||||
|
||||
@ -86,11 +87,16 @@ public interface OioServerSocketChannelConfig extends ServerSocketChannelConfig
|
||||
OioServerSocketChannelConfig setAutoClose(boolean autoClose);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
OioServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
OioServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
@Override
|
||||
OioServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
@Override
|
||||
OioServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelConfig;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.MessageSizeEstimator;
|
||||
import io.netty.channel.RecvByteBufAllocator;
|
||||
import io.netty.channel.WriteBufferWaterMark;
|
||||
import io.netty.channel.socket.SocketChannelConfig;
|
||||
|
||||
/**
|
||||
@ -101,11 +102,16 @@ public interface OioSocketChannelConfig extends SocketChannelConfig {
|
||||
OioSocketChannelConfig setAutoClose(boolean autoClose);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
OioSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
OioSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||
|
||||
@Override
|
||||
OioSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||
|
||||
@Override
|
||||
OioSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user