Class WriteBufferWaterMark
java.lang.Object
io.netty.channel.WriteBufferWaterMark
WriteBufferWaterMark is used to set low water mark and high water mark for the write buffer.
If the number of bytes queued in the write buffer exceeds the
high water mark, Channel.isWritable()
will start to return false.
If the number of bytes queued in the write buffer exceeds the
high water mark and then
dropped down below the low water mark,
Channel.isWritable() will start to return
true again.
Note that messages needs to be handled by the MessageSizeEstimator
used by the channel for Channel.isWritable() to provide accurate back-pressure.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WriteBufferWaterMarkprivate static final intprivate static final intprivate final intprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionWriteBufferWaterMark(int low, int high) Create a new instance.WriteBufferWaterMark(int low, int high, boolean validate) This constructor is needed to keep backward-compatibility. -
Method Summary
-
Field Details
-
DEFAULT_LOW_WATER_MARK
private static final int DEFAULT_LOW_WATER_MARK- See Also:
-
DEFAULT_HIGH_WATER_MARK
private static final int DEFAULT_HIGH_WATER_MARK- See Also:
-
DEFAULT
-
low
private final int low -
high
private final int high
-
-
Constructor Details
-
WriteBufferWaterMark
public WriteBufferWaterMark(int low, int high) Create a new instance.- Parameters:
low- low water mark for write buffer.high- high water mark for write buffer
-
WriteBufferWaterMark
WriteBufferWaterMark(int low, int high, boolean validate) This constructor is needed to keep backward-compatibility.
-
-
Method Details
-
low
public int low()Returns the low water mark for the write buffer. -
high
public int high()Returns the high water mark for the write buffer. -
toString
-