[#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.DefaultChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -96,17 +97,25 @@ public class EpollChannelConfig extends DefaultChannelConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public EpollChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public EpollChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EpollChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EpollChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public EpollChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelOption;
|
|||||||
import io.netty.channel.FixedRecvByteBufAllocator;
|
import io.netty.channel.FixedRecvByteBufAllocator;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.channel.socket.DatagramChannelConfig;
|
import io.netty.channel.socket.DatagramChannelConfig;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -138,17 +139,25 @@ public final class EpollDatagramChannelConfig extends EpollChannelConfig impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollDatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public EpollDatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollDatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public EpollDatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EpollDatagramChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EpollDatagramChannelConfig setAutoClose(boolean autoClose) {
|
public EpollDatagramChannelConfig setAutoClose(boolean autoClose) {
|
||||||
super.setAutoClose(autoClose);
|
super.setAutoClose(autoClose);
|
||||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBufAllocator;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.channel.unix.DomainSocketChannelConfig;
|
import io.netty.channel.unix.DomainSocketChannelConfig;
|
||||||
import io.netty.channel.unix.DomainSocketReadMode;
|
import io.netty.channel.unix.DomainSocketReadMode;
|
||||||
|
|
||||||
@ -103,17 +104,25 @@ public final class EpollDomainSocketChannelConfig extends EpollChannelConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollDomainSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public EpollDomainSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollDomainSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public EpollDomainSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EpollDomainSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EpollDomainSocketChannelConfig setAutoRead(boolean autoRead) {
|
public EpollDomainSocketChannelConfig setAutoRead(boolean autoRead) {
|
||||||
super.setAutoRead(autoRead);
|
super.setAutoRead(autoRead);
|
||||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelException;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.util.NetUtil;
|
import io.netty.util.NetUtil;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -191,17 +192,25 @@ public class EpollServerChannelConfig extends EpollChannelConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public EpollServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public EpollServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EpollServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EpollServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public EpollServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelException;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.channel.socket.ServerSocketChannelConfig;
|
import io.netty.channel.socket.ServerSocketChannelConfig;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -141,17 +142,25 @@ public final class EpollServerSocketChannelConfig extends EpollServerChannelConf
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public EpollServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public EpollServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EpollServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EpollServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public EpollServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelException;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.channel.socket.SocketChannelConfig;
|
import io.netty.channel.socket.SocketChannelConfig;
|
||||||
import io.netty.util.internal.PlatformDependent;
|
import io.netty.util.internal.PlatformDependent;
|
||||||
|
|
||||||
@ -528,17 +529,25 @@ public final class EpollSocketChannelConfig extends EpollChannelConfig implement
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public EpollSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public EpollSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public EpollSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EpollSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EpollSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public EpollSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBufAllocator;
|
|||||||
import io.netty.channel.ChannelConfig;
|
import io.netty.channel.ChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Special {@link ChannelConfig} for {@link DomainSocketChannel}s.
|
* Special {@link ChannelConfig} for {@link DomainSocketChannel}s.
|
||||||
@ -48,11 +49,16 @@ public interface DomainSocketChannelConfig extends ChannelConfig {
|
|||||||
DomainSocketChannelConfig setAutoClose(boolean autoClose);
|
DomainSocketChannelConfig setAutoClose(boolean autoClose);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
DomainSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
DomainSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
DomainSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
DomainSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
DomainSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
DomainSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
DomainSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelOption;
|
|||||||
import io.netty.channel.DefaultChannelConfig;
|
import io.netty.channel.DefaultChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -249,17 +250,25 @@ final class DefaultRxtxChannelConfig extends DefaultChannelConfig implements Rxt
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public RxtxChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public RxtxChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public RxtxChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public RxtxChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RxtxChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RxtxChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public RxtxChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -20,6 +20,7 @@ import io.netty.buffer.ByteBufAllocator;
|
|||||||
import io.netty.channel.ChannelConfig;
|
import io.netty.channel.ChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A configuration class for RXTX device connections.
|
* A configuration class for RXTX device connections.
|
||||||
@ -293,11 +294,16 @@ public interface RxtxChannelConfig extends ChannelConfig {
|
|||||||
RxtxChannelConfig setAutoClose(boolean autoClose);
|
RxtxChannelConfig setAutoClose(boolean autoClose);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
RxtxChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
RxtxChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
RxtxChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
RxtxChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
RxtxChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
RxtxChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
RxtxChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ import io.netty.channel.ChannelOption;
|
|||||||
import io.netty.channel.DefaultChannelConfig;
|
import io.netty.channel.DefaultChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.util.internal.PlatformDependent;
|
import io.netty.util.internal.PlatformDependent;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -218,17 +219,25 @@ public class DefaultSctpChannelConfig extends DefaultChannelConfig implements Sc
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public SctpChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public SctpChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public SctpChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public SctpChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SctpChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SctpChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public SctpChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -24,6 +24,7 @@ import io.netty.channel.ChannelOption;
|
|||||||
import io.netty.channel.DefaultChannelConfig;
|
import io.netty.channel.DefaultChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.util.NetUtil;
|
import io.netty.util.NetUtil;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -200,17 +201,25 @@ public class DefaultSctpServerChannelConfig extends DefaultChannelConfig impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public SctpServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public SctpServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public SctpServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public SctpServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SctpServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SctpServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public SctpServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelConfig;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link ChannelConfig} for a {@link SctpChannel}.
|
* A {@link ChannelConfig} for a {@link SctpChannel}.
|
||||||
@ -121,11 +122,16 @@ public interface SctpChannelConfig extends ChannelConfig {
|
|||||||
SctpChannelConfig setAutoClose(boolean autoClose);
|
SctpChannelConfig setAutoClose(boolean autoClose);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
SctpChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
SctpChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
SctpChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
SctpChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
SctpChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
SctpChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
SctpChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelConfig;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link ChannelConfig} for a {@link SctpServerChannelConfig}.
|
* A {@link ChannelConfig} for a {@link SctpServerChannelConfig}.
|
||||||
@ -116,11 +117,16 @@ public interface SctpServerChannelConfig extends ChannelConfig {
|
|||||||
SctpServerChannelConfig setAutoClose(boolean autoClose);
|
SctpServerChannelConfig setAutoClose(boolean autoClose);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
SctpServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
SctpServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
SctpServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
SctpServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
SctpServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
SctpServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
SctpServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ import io.netty.channel.ChannelOption;
|
|||||||
import io.netty.channel.DefaultChannelConfig;
|
import io.netty.channel.DefaultChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -284,17 +285,25 @@ public class DefaultUdtChannelConfig extends DefaultChannelConfig implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public UdtChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public UdtChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public UdtChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public UdtChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UdtChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UdtChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public UdtChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -20,6 +20,7 @@ import io.netty.buffer.ByteBufAllocator;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -180,17 +181,25 @@ public class DefaultUdtServerChannelConfig extends DefaultUdtChannelConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public UdtServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public UdtServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public UdtServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public UdtServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UdtServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UdtServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public UdtServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -23,6 +23,7 @@ import io.netty.channel.ChannelException;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link ChannelConfig} for a {@link UdtChannel}.
|
* A {@link ChannelConfig} for a {@link UdtChannel}.
|
||||||
@ -135,11 +136,16 @@ public interface UdtChannelConfig extends ChannelConfig {
|
|||||||
UdtChannelConfig setAutoClose(boolean autoClose);
|
UdtChannelConfig setAutoClose(boolean autoClose);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
UdtChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
UdtChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
UdtChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
UdtChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
UdtChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
UdtChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
UdtChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import io.netty.channel.ChannelException;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link ChannelConfig} for a {@link UdtServerChannel}.
|
* A {@link ChannelConfig} for a {@link UdtServerChannel}.
|
||||||
@ -93,11 +94,16 @@ public interface UdtServerChannelConfig extends UdtChannelConfig {
|
|||||||
UdtServerChannelConfig setSystemSendBufferSize(int size);
|
UdtServerChannelConfig setSystemSendBufferSize(int size);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
UdtServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
UdtServerChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
UdtServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
UdtServerChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
UdtServerChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
UdtServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
UdtServerChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,8 @@ import java.util.Map;
|
|||||||
* </tr><tr>
|
* </tr><tr>
|
||||||
* <td>{@link ChannelOption#WRITE_SPIN_COUNT}</td><td>{@link #setWriteSpinCount(int)}</td>
|
* <td>{@link ChannelOption#WRITE_SPIN_COUNT}</td><td>{@link #setWriteSpinCount(int)}</td>
|
||||||
* </tr><tr>
|
* </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>
|
* <td>{@link ChannelOption#ALLOCATOR}</td><td>{@link #setAllocator(ByteBufAllocator)}</td>
|
||||||
* </tr><tr>
|
* </tr><tr>
|
||||||
* <td>{@link ChannelOption#AUTO_READ}</td><td>{@link #setAutoRead(boolean)}</td>
|
* <td>{@link ChannelOption#AUTO_READ}</td><td>{@link #setAutoRead(boolean)}</td>
|
||||||
@ -218,10 +220,13 @@ public interface ChannelConfig {
|
|||||||
int getWriteBufferHighWaterMark();
|
int getWriteBufferHighWaterMark();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated Use {@link #setWriteBufferWaterMark(WriteBufferWaterMark)}
|
||||||
|
* <p>
|
||||||
* Sets the high water mark of the write buffer. If the number of bytes
|
* 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()}
|
* queued in the write buffer exceeds this value, {@link Channel#isWritable()}
|
||||||
* will start to return {@code false}.
|
* will start to return {@code false}.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -234,12 +239,15 @@ public interface ChannelConfig {
|
|||||||
int getWriteBufferLowWaterMark();
|
int getWriteBufferLowWaterMark();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated Use {@link #setWriteBufferWaterMark(WriteBufferWaterMark)}
|
||||||
|
* <p>
|
||||||
* Sets the low water mark of the write buffer. Once the number of bytes
|
* Sets the low water mark of the write buffer. Once the number of bytes
|
||||||
* queued in the write buffer exceeded the
|
* queued in the write buffer exceeded the
|
||||||
* {@linkplain #setWriteBufferHighWaterMark(int) high water mark} and then
|
* {@linkplain #setWriteBufferHighWaterMark(int) high water mark} and then
|
||||||
* dropped down below this value, {@link Channel#isWritable()} will start to return
|
* dropped down below this value, {@link Channel#isWritable()} will start to return
|
||||||
* {@code true} again.
|
* {@code true} again.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -253,4 +261,16 @@ public interface ChannelConfig {
|
|||||||
* to detect the size of a message.
|
* to detect the size of a message.
|
||||||
*/
|
*/
|
||||||
ChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
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> MAX_MESSAGES_PER_READ = valueOf("MAX_MESSAGES_PER_READ");
|
||||||
public static final ChannelOption<Integer> WRITE_SPIN_COUNT = valueOf("WRITE_SPIN_COUNT");
|
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");
|
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<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> ALLOW_HALF_CLOSURE = valueOf("ALLOW_HALF_CLOSURE");
|
||||||
public static final ChannelOption<Boolean> AUTO_READ = valueOf("AUTO_READ");
|
public static final ChannelOption<Boolean> AUTO_READ = valueOf("AUTO_READ");
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
package io.netty.channel;
|
package io.netty.channel;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBufAllocator;
|
import io.netty.buffer.ByteBufAllocator;
|
||||||
import io.netty.channel.socket.SocketChannelConfig;
|
|
||||||
import io.netty.util.internal.PlatformDependent;
|
import io.netty.util.internal.PlatformDependent;
|
||||||
|
|
||||||
import java.util.IdentityHashMap;
|
import java.util.IdentityHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
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.ALLOCATOR;
|
||||||
import static io.netty.channel.ChannelOption.AUTO_CLOSE;
|
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.RCVBUF_ALLOCATOR;
|
||||||
import static io.netty.channel.ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK;
|
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_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.channel.ChannelOption.WRITE_SPIN_COUNT;
|
||||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default {@link SocketChannelConfig} implementation.
|
* The default {@link ChannelConfig} implementation.
|
||||||
*/
|
*/
|
||||||
public class DefaultChannelConfig implements ChannelConfig {
|
public class DefaultChannelConfig implements ChannelConfig {
|
||||||
private static final MessageSizeEstimator DEFAULT_MSG_SIZE_ESTIMATOR = DefaultMessageSizeEstimator.DEFAULT;
|
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 int DEFAULT_CONNECT_TIMEOUT = 30000;
|
||||||
|
|
||||||
private static final AtomicIntegerFieldUpdater<DefaultChannelConfig> AUTOREAD_UPDATER;
|
private static final AtomicIntegerFieldUpdater<DefaultChannelConfig> AUTOREAD_UPDATER;
|
||||||
|
private static final AtomicReferenceFieldUpdater<DefaultChannelConfig, WriteBufferWaterMark> WATERMARK_UPDATER;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
AtomicIntegerFieldUpdater<DefaultChannelConfig> autoReadUpdater =
|
AtomicIntegerFieldUpdater<DefaultChannelConfig> autoReadUpdater =
|
||||||
@ -53,6 +55,14 @@ public class DefaultChannelConfig implements ChannelConfig {
|
|||||||
autoReadUpdater = AtomicIntegerFieldUpdater.newUpdater(DefaultChannelConfig.class, "autoRead");
|
autoReadUpdater = AtomicIntegerFieldUpdater.newUpdater(DefaultChannelConfig.class, "autoRead");
|
||||||
}
|
}
|
||||||
AUTOREAD_UPDATER = autoReadUpdater;
|
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;
|
protected final Channel channel;
|
||||||
@ -66,8 +76,7 @@ public class DefaultChannelConfig implements ChannelConfig {
|
|||||||
@SuppressWarnings("FieldMayBeFinal")
|
@SuppressWarnings("FieldMayBeFinal")
|
||||||
private volatile int autoRead = 1;
|
private volatile int autoRead = 1;
|
||||||
private volatile boolean autoClose = true;
|
private volatile boolean autoClose = true;
|
||||||
private volatile int writeBufferHighWaterMark = 64 * 1024;
|
private volatile WriteBufferWaterMark writeBufferWaterMark = WriteBufferWaterMark.DEFAULT;
|
||||||
private volatile int writeBufferLowWaterMark = 32 * 1024;
|
|
||||||
|
|
||||||
public DefaultChannelConfig(Channel channel) {
|
public DefaultChannelConfig(Channel channel) {
|
||||||
this(channel, new AdaptiveRecvByteBufAllocator());
|
this(channel, new AdaptiveRecvByteBufAllocator());
|
||||||
@ -85,7 +94,7 @@ public class DefaultChannelConfig implements ChannelConfig {
|
|||||||
null,
|
null,
|
||||||
CONNECT_TIMEOUT_MILLIS, MAX_MESSAGES_PER_READ, WRITE_SPIN_COUNT,
|
CONNECT_TIMEOUT_MILLIS, MAX_MESSAGES_PER_READ, WRITE_SPIN_COUNT,
|
||||||
ALLOCATOR, AUTO_READ, AUTO_CLOSE, RCVBUF_ALLOCATOR, WRITE_BUFFER_HIGH_WATER_MARK,
|
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(
|
protected Map<ChannelOption<?>, Object> getOptions(
|
||||||
@ -150,6 +159,9 @@ public class DefaultChannelConfig implements ChannelConfig {
|
|||||||
if (option == WRITE_BUFFER_LOW_WATER_MARK) {
|
if (option == WRITE_BUFFER_LOW_WATER_MARK) {
|
||||||
return (T) Integer.valueOf(getWriteBufferLowWaterMark());
|
return (T) Integer.valueOf(getWriteBufferLowWaterMark());
|
||||||
}
|
}
|
||||||
|
if (option == WRITE_BUFFER_WATER_MARK) {
|
||||||
|
return (T) getWriteBufferWaterMark();
|
||||||
|
}
|
||||||
if (option == MESSAGE_SIZE_ESTIMATOR) {
|
if (option == MESSAGE_SIZE_ESTIMATOR) {
|
||||||
return (T) getMessageSizeEstimator();
|
return (T) getMessageSizeEstimator();
|
||||||
}
|
}
|
||||||
@ -179,6 +191,8 @@ public class DefaultChannelConfig implements ChannelConfig {
|
|||||||
setWriteBufferHighWaterMark((Integer) value);
|
setWriteBufferHighWaterMark((Integer) value);
|
||||||
} else if (option == WRITE_BUFFER_LOW_WATER_MARK) {
|
} else if (option == WRITE_BUFFER_LOW_WATER_MARK) {
|
||||||
setWriteBufferLowWaterMark((Integer) value);
|
setWriteBufferLowWaterMark((Integer) value);
|
||||||
|
} else if (option == WRITE_BUFFER_WATER_MARK) {
|
||||||
|
setWriteBufferWaterMark((WriteBufferWaterMark) value);
|
||||||
} else if (option == MESSAGE_SIZE_ESTIMATOR) {
|
} else if (option == MESSAGE_SIZE_ESTIMATOR) {
|
||||||
setMessageSizeEstimator((MessageSizeEstimator) value);
|
setMessageSizeEstimator((MessageSizeEstimator) value);
|
||||||
} else {
|
} else {
|
||||||
@ -337,47 +351,72 @@ public class DefaultChannelConfig implements ChannelConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public int getWriteBufferHighWaterMark() {
|
public int getWriteBufferHighWaterMark() {
|
||||||
return writeBufferHighWaterMark;
|
return writeBufferWaterMark.high();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public ChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
if (writeBufferHighWaterMark < getWriteBufferLowWaterMark()) {
|
|
||||||
throw new IllegalArgumentException(
|
|
||||||
"writeBufferHighWaterMark cannot be less than " +
|
|
||||||
"writeBufferLowWaterMark (" + getWriteBufferLowWaterMark() + "): " +
|
|
||||||
writeBufferHighWaterMark);
|
|
||||||
}
|
|
||||||
if (writeBufferHighWaterMark < 0) {
|
if (writeBufferHighWaterMark < 0) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"writeBufferHighWaterMark must be >= 0");
|
"writeBufferHighWaterMark must be >= 0");
|
||||||
}
|
}
|
||||||
this.writeBufferHighWaterMark = writeBufferHighWaterMark;
|
for (;;) {
|
||||||
return this;
|
WriteBufferWaterMark waterMark = writeBufferWaterMark;
|
||||||
}
|
if (writeBufferHighWaterMark < waterMark.low()) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
@Override
|
"writeBufferHighWaterMark cannot be less than " +
|
||||||
public int getWriteBufferLowWaterMark() {
|
"writeBufferLowWaterMark (" + waterMark.low() + "): " +
|
||||||
return writeBufferLowWaterMark;
|
writeBufferHighWaterMark);
|
||||||
}
|
}
|
||||||
|
if (WATERMARK_UPDATER.compareAndSet(this, waterMark,
|
||||||
@Override
|
new WriteBufferWaterMark(waterMark.low(), writeBufferHighWaterMark, false))) {
|
||||||
public ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
return this;
|
||||||
if (writeBufferLowWaterMark > getWriteBufferHighWaterMark()) {
|
}
|
||||||
throw new IllegalArgumentException(
|
|
||||||
"writeBufferLowWaterMark cannot be greater than " +
|
|
||||||
"writeBufferHighWaterMark (" + getWriteBufferHighWaterMark() + "): " +
|
|
||||||
writeBufferLowWaterMark);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Deprecated
|
||||||
|
public int getWriteBufferLowWaterMark() {
|
||||||
|
return writeBufferWaterMark.low();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Deprecated
|
||||||
|
public ChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
if (writeBufferLowWaterMark < 0) {
|
if (writeBufferLowWaterMark < 0) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"writeBufferLowWaterMark must be >= 0");
|
"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;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WriteBufferWaterMark getWriteBufferWaterMark() {
|
||||||
|
return writeBufferWaterMark;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MessageSizeEstimator getMessageSizeEstimator() {
|
public MessageSizeEstimator getMessageSizeEstimator() {
|
||||||
return msgSizeEstimator;
|
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.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.NetworkInterface;
|
import java.net.NetworkInterface;
|
||||||
@ -180,4 +181,8 @@ public interface DatagramChannelConfig extends ChannelConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
DatagramChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
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.FixedRecvByteBufAllocator;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.util.internal.PlatformDependent;
|
import io.netty.util.internal.PlatformDependent;
|
||||||
import io.netty.util.internal.logging.InternalLogger;
|
import io.netty.util.internal.logging.InternalLogger;
|
||||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||||
@ -401,17 +402,25 @@ public class DefaultDatagramChannelConfig extends DefaultChannelConfig implement
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public DatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public DatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public DatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public DatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DatagramChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatagramChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public DatagramChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelOption;
|
|||||||
import io.netty.channel.DefaultChannelConfig;
|
import io.netty.channel.DefaultChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.util.NetUtil;
|
import io.netty.util.NetUtil;
|
||||||
|
|
||||||
import java.net.ServerSocket;
|
import java.net.ServerSocket;
|
||||||
@ -185,17 +186,25 @@ public class DefaultServerSocketChannelConfig extends DefaultChannelConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public ServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public ServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public ServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public ServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public ServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelOption;
|
|||||||
import io.netty.channel.DefaultChannelConfig;
|
import io.netty.channel.DefaultChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.util.internal.PlatformDependent;
|
import io.netty.util.internal.PlatformDependent;
|
||||||
|
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
@ -323,17 +324,25 @@ public class DefaultSocketChannelConfig extends DefaultChannelConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public SocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public SocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public SocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public SocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public SocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBufAllocator;
|
|||||||
import io.netty.channel.ChannelConfig;
|
import io.netty.channel.ChannelConfig;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
import java.net.ServerSocket;
|
import java.net.ServerSocket;
|
||||||
import java.net.StandardSocketOptions;
|
import java.net.StandardSocketOptions;
|
||||||
@ -105,4 +106,22 @@ public interface ServerSocketChannelConfig extends ChannelConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
ServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
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.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
|
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.StandardSocketOptions;
|
import java.net.StandardSocketOptions;
|
||||||
@ -181,4 +182,8 @@ public interface SocketChannelConfig extends ChannelConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
SocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
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.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.channel.socket.DefaultServerSocketChannelConfig;
|
import io.netty.channel.socket.DefaultServerSocketChannelConfig;
|
||||||
import io.netty.channel.socket.ServerSocketChannel;
|
import io.netty.channel.socket.ServerSocketChannel;
|
||||||
|
|
||||||
@ -165,17 +166,25 @@ public class DefaultOioServerSocketChannelConfig extends DefaultServerSocketChan
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public OioServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public OioServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public OioServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public OioServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OioServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OioServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public OioServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelException;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.channel.socket.DefaultSocketChannelConfig;
|
import io.netty.channel.socket.DefaultSocketChannelConfig;
|
||||||
import io.netty.channel.socket.SocketChannel;
|
import io.netty.channel.socket.SocketChannel;
|
||||||
|
|
||||||
@ -193,17 +194,25 @@ public class DefaultOioSocketChannelConfig extends DefaultSocketChannelConfig im
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public OioSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
public OioSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark) {
|
||||||
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
super.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public OioSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
public OioSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark) {
|
||||||
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
super.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OioSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark) {
|
||||||
|
super.setWriteBufferWaterMark(writeBufferWaterMark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OioSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
public OioSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator) {
|
||||||
super.setMessageSizeEstimator(estimator);
|
super.setMessageSizeEstimator(estimator);
|
||||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBufAllocator;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.channel.socket.ServerSocketChannelConfig;
|
import io.netty.channel.socket.ServerSocketChannelConfig;
|
||||||
|
|
||||||
|
|
||||||
@ -86,11 +87,16 @@ public interface OioServerSocketChannelConfig extends ServerSocketChannelConfig
|
|||||||
OioServerSocketChannelConfig setAutoClose(boolean autoClose);
|
OioServerSocketChannelConfig setAutoClose(boolean autoClose);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
OioServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
OioServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
OioServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
OioServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
OioServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
OioServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
OioServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import io.netty.channel.ChannelConfig;
|
|||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.MessageSizeEstimator;
|
import io.netty.channel.MessageSizeEstimator;
|
||||||
import io.netty.channel.RecvByteBufAllocator;
|
import io.netty.channel.RecvByteBufAllocator;
|
||||||
|
import io.netty.channel.WriteBufferWaterMark;
|
||||||
import io.netty.channel.socket.SocketChannelConfig;
|
import io.netty.channel.socket.SocketChannelConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,11 +102,16 @@ public interface OioSocketChannelConfig extends SocketChannelConfig {
|
|||||||
OioSocketChannelConfig setAutoClose(boolean autoClose);
|
OioSocketChannelConfig setAutoClose(boolean autoClose);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
OioSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
OioSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
OioSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
OioSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
OioSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
OioSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
OioSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user