Add *ReceiveBufferSize / *SendBufferSize methods to DomainSocketChannelConfig interface (#9602)
Motivation:
aebe206
added support for using a ChannelOption to set / get Buffer sizes but did not add the methods to the DomainSocketChannelConfig interface itself (due not be able to break the API)
Modifications:
Add methods to interface (as this is a next major release)
Result:
Easier access to configure these buffer sizes
This commit is contained in:
parent
f81d02bdc7
commit
1275cfd8f8
@ -187,6 +187,7 @@ public final class EpollDomainSocketChannelConfig extends EpollChannelConfig
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getSendBufferSize() {
|
public int getSendBufferSize() {
|
||||||
try {
|
try {
|
||||||
return ((EpollDomainSocketChannel) channel).socket.getSendBufferSize();
|
return ((EpollDomainSocketChannel) channel).socket.getSendBufferSize();
|
||||||
@ -195,6 +196,7 @@ public final class EpollDomainSocketChannelConfig extends EpollChannelConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public EpollDomainSocketChannelConfig setSendBufferSize(int sendBufferSize) {
|
public EpollDomainSocketChannelConfig setSendBufferSize(int sendBufferSize) {
|
||||||
try {
|
try {
|
||||||
((EpollDomainSocketChannel) channel).socket.setSendBufferSize(sendBufferSize);
|
((EpollDomainSocketChannel) channel).socket.setSendBufferSize(sendBufferSize);
|
||||||
@ -204,6 +206,7 @@ public final class EpollDomainSocketChannelConfig extends EpollChannelConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getReceiveBufferSize() {
|
public int getReceiveBufferSize() {
|
||||||
try {
|
try {
|
||||||
return ((EpollDomainSocketChannel) channel).socket.getReceiveBufferSize();
|
return ((EpollDomainSocketChannel) channel).socket.getReceiveBufferSize();
|
||||||
@ -212,6 +215,7 @@ public final class EpollDomainSocketChannelConfig extends EpollChannelConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public EpollDomainSocketChannelConfig setReceiveBufferSize(int receiveBufferSize) {
|
public EpollDomainSocketChannelConfig setReceiveBufferSize(int receiveBufferSize) {
|
||||||
try {
|
try {
|
||||||
((EpollDomainSocketChannel) channel).socket.setReceiveBufferSize(receiveBufferSize);
|
((EpollDomainSocketChannel) channel).socket.setReceiveBufferSize(receiveBufferSize);
|
||||||
|
@ -172,6 +172,7 @@ public final class KQueueDomainSocketChannelConfig extends KQueueChannelConfig i
|
|||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getSendBufferSize() {
|
public int getSendBufferSize() {
|
||||||
try {
|
try {
|
||||||
return ((KQueueDomainSocketChannel) channel).socket.getSendBufferSize();
|
return ((KQueueDomainSocketChannel) channel).socket.getSendBufferSize();
|
||||||
@ -180,6 +181,7 @@ public final class KQueueDomainSocketChannelConfig extends KQueueChannelConfig i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public KQueueDomainSocketChannelConfig setSendBufferSize(int sendBufferSize) {
|
public KQueueDomainSocketChannelConfig setSendBufferSize(int sendBufferSize) {
|
||||||
try {
|
try {
|
||||||
((KQueueDomainSocketChannel) channel).socket.setSendBufferSize(sendBufferSize);
|
((KQueueDomainSocketChannel) channel).socket.setSendBufferSize(sendBufferSize);
|
||||||
@ -189,6 +191,7 @@ public final class KQueueDomainSocketChannelConfig extends KQueueChannelConfig i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getReceiveBufferSize() {
|
public int getReceiveBufferSize() {
|
||||||
try {
|
try {
|
||||||
return ((KQueueDomainSocketChannel) channel).socket.getReceiveBufferSize();
|
return ((KQueueDomainSocketChannel) channel).socket.getReceiveBufferSize();
|
||||||
@ -197,6 +200,7 @@ public final class KQueueDomainSocketChannelConfig extends KQueueChannelConfig i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public KQueueDomainSocketChannelConfig setReceiveBufferSize(int receiveBufferSize) {
|
public KQueueDomainSocketChannelConfig setReceiveBufferSize(int receiveBufferSize) {
|
||||||
try {
|
try {
|
||||||
((KQueueDomainSocketChannel) channel).socket.setReceiveBufferSize(receiveBufferSize);
|
((KQueueDomainSocketChannel) channel).socket.setReceiveBufferSize(receiveBufferSize);
|
||||||
|
@ -20,6 +20,9 @@ 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 io.netty.channel.WriteBufferWaterMark;
|
||||||
|
import io.netty.channel.socket.SocketChannelConfig;
|
||||||
|
|
||||||
|
import java.net.StandardSocketOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Special {@link ChannelConfig} for {@link DomainSocketChannel}s.
|
* Special {@link ChannelConfig} for {@link DomainSocketChannel}s.
|
||||||
@ -62,6 +65,26 @@ public interface DomainSocketChannelConfig extends ChannelConfig {
|
|||||||
@Override
|
@Override
|
||||||
DomainSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
DomainSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the {@link StandardSocketOptions#SO_SNDBUF} option.
|
||||||
|
*/
|
||||||
|
int getSendBufferSize();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the {@link StandardSocketOptions#SO_SNDBUF} option.
|
||||||
|
*/
|
||||||
|
DomainSocketChannelConfig setSendBufferSize(int sendBufferSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the {@link StandardSocketOptions#SO_RCVBUF} option.
|
||||||
|
*/
|
||||||
|
int getReceiveBufferSize();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the {@link StandardSocketOptions#SO_RCVBUF} option.
|
||||||
|
*/
|
||||||
|
DomainSocketChannelConfig setReceiveBufferSize(int receiveBufferSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the {@link DomainSocketReadMode} for the channel. The default is
|
* Change the {@link DomainSocketReadMode} for the channel. The default is
|
||||||
* {@link DomainSocketReadMode#BYTES} which means bytes will be read from the
|
* {@link DomainSocketReadMode#BYTES} which means bytes will be read from the
|
||||||
|
Loading…
Reference in New Issue
Block a user