|
Expand Up
|
@@ -172,10 +172,9 @@ int getSendBufferSize() { |
|
|
} |
|
|
} |
|
|
|
|
|
EpollDatagramChannelConfig setSendBufferSize(int sendBufferSize) { |
|
|
private void setSendBufferSize(int sendBufferSize) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setSendBufferSize(sendBufferSize); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
Expand All
|
@@ -189,78 +188,73 @@ int getReceiveBufferSize() { |
|
|
} |
|
|
} |
|
|
|
|
|
EpollDatagramChannelConfig setReceiveBufferSize(int receiveBufferSize) { |
|
|
private void setReceiveBufferSize(int receiveBufferSize) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setReceiveBufferSize(receiveBufferSize); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
int getTrafficClass() { |
|
|
private int getTrafficClass() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.getTrafficClass(); |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
EpollDatagramChannelConfig setTrafficClass(int trafficClass) { |
|
|
private void setTrafficClass(int trafficClass) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setTrafficClass(trafficClass); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
boolean isReuseAddress() { |
|
|
private boolean isReuseAddress() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.isReuseAddress(); |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
EpollDatagramChannelConfig setReuseAddress(boolean reuseAddress) { |
|
|
private void setReuseAddress(boolean reuseAddress) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setReuseAddress(reuseAddress); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
boolean isBroadcast() { |
|
|
private boolean isBroadcast() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.isBroadcast(); |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
EpollDatagramChannelConfig setBroadcast(boolean broadcast) { |
|
|
private void setBroadcast(boolean broadcast) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setBroadcast(broadcast); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
boolean isLoopbackModeDisabled() { |
|
|
private boolean isLoopbackModeDisabled() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.isLoopbackModeDisabled(); |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
EpollDatagramChannelConfig setLoopbackModeDisabled(boolean loopbackModeDisabled) { |
|
|
private void setLoopbackModeDisabled(boolean loopbackModeDisabled) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setLoopbackModeDisabled(loopbackModeDisabled); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
Expand All
|
@@ -274,45 +268,42 @@ int getTimeToLive() { |
|
|
} |
|
|
} |
|
|
|
|
|
EpollDatagramChannelConfig setTimeToLive(int ttl) { |
|
|
private void setTimeToLive(int ttl) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setTimeToLive(ttl); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
InetAddress getInterface() { |
|
|
private InetAddress getInterface() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.getInterface(); |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
EpollDatagramChannelConfig setInterface(InetAddress interfaceAddress) { |
|
|
private void setInterface(InetAddress interfaceAddress) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setInterface(interfaceAddress); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
NetworkInterface getNetworkInterface() { |
|
|
private NetworkInterface getNetworkInterface() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.getNetworkInterface(); |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
} |
|
|
|
|
|
EpollDatagramChannelConfig setNetworkInterface(NetworkInterface networkInterface) { |
|
|
private void setNetworkInterface(NetworkInterface networkInterface) { |
|
|
try { |
|
|
AbstractEpollChannel datagramChannel = (AbstractEpollChannel) channel; |
|
|
datagramChannel.socket.setNetworkInterface(networkInterface); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
Expand All
|
@@ -321,7 +312,7 @@ EpollDatagramChannelConfig setNetworkInterface(NetworkInterface networkInterface |
|
|
/** |
|
|
* Returns {@code true} if the SO_REUSEPORT option is set. |
|
|
*/ |
|
|
boolean isReusePort() { |
|
|
private boolean isReusePort() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.isReusePort(); |
|
|
} catch (IOException e) { |
|
Expand All
|
@@ -336,10 +327,9 @@ boolean isReusePort() { |
|
|
* Be aware this method needs be called before {@link EpollDatagramChannel#bind(java.net.SocketAddress)} to have |
|
|
* any affect. |
|
|
*/ |
|
|
EpollDatagramChannelConfig setReusePort(boolean reusePort) { |
|
|
private void setReusePort(boolean reusePort) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setReusePort(reusePort); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
Expand All
|
@@ -349,7 +339,7 @@ EpollDatagramChannelConfig setReusePort(boolean reusePort) { |
|
|
* Returns {@code true} if <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_TRANSPARENT</a> is enabled, |
|
|
* {@code false} otherwise. |
|
|
*/ |
|
|
boolean isIpTransparent() { |
|
|
private boolean isIpTransparent() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.isIpTransparent(); |
|
|
} catch (IOException e) { |
|
Expand All
|
@@ -361,10 +351,9 @@ boolean isIpTransparent() { |
|
|
* If {@code true} is used <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_TRANSPARENT</a> is enabled, |
|
|
* {@code false} for disable it. Default is disabled. |
|
|
*/ |
|
|
EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent) { |
|
|
private void setIpTransparent(boolean ipTransparent) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setIpTransparent(ipTransparent); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
Expand All
|
@@ -374,7 +363,7 @@ EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent) { |
|
|
* Returns {@code true} if <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_FREEBIND</a> is enabled, |
|
|
* {@code false} otherwise. |
|
|
*/ |
|
|
boolean isFreeBind() { |
|
|
private boolean isFreeBind() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.isIpFreeBind(); |
|
|
} catch (IOException e) { |
|
Expand All
|
@@ -386,10 +375,9 @@ boolean isFreeBind() { |
|
|
* If {@code true} is used <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_FREEBIND</a> is enabled, |
|
|
* {@code false} for disable it. Default is disabled. |
|
|
*/ |
|
|
EpollDatagramChannelConfig setFreeBind(boolean freeBind) { |
|
|
private void setFreeBind(boolean freeBind) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setIpFreeBind(freeBind); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
Expand All
|
@@ -399,7 +387,7 @@ EpollDatagramChannelConfig setFreeBind(boolean freeBind) { |
|
|
* Returns {@code true} if <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_RECVORIGDSTADDR</a> is |
|
|
* enabled, {@code false} otherwise. |
|
|
*/ |
|
|
boolean isIpRecvOrigDestAddr() { |
|
|
private boolean isIpRecvOrigDestAddr() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.isIpRecvOrigDestAddr(); |
|
|
} catch (IOException e) { |
|
Expand All
|
@@ -411,10 +399,9 @@ boolean isIpRecvOrigDestAddr() { |
|
|
* If {@code true} is used <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_RECVORIGDSTADDR</a> is |
|
|
* enabled, {@code false} for disable it. Default is disabled. |
|
|
*/ |
|
|
EpollDatagramChannelConfig setIpRecvOrigDestAddr(boolean ipTransparent) { |
|
|
private void setIpRecvOrigDestAddr(boolean ipTransparent) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setIpRecvOrigDestAddr(ipTransparent); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
Expand All
|
@@ -424,7 +411,7 @@ EpollDatagramChannelConfig setIpRecvOrigDestAddr(boolean ipTransparent) { |
|
|
* Returns {@code true} if <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_MULTICAST_ALL</a> (or |
|
|
* IPV6_MULTICAST_ALL for IPV6) is enabled, {@code false} otherwise. |
|
|
*/ |
|
|
boolean isIpMulticastAll() { |
|
|
private boolean isIpMulticastAll() { |
|
|
try { |
|
|
return ((AbstractEpollChannel) channel).socket.isIpMulticastAll(); |
|
|
} catch (IOException e) { |
|
Expand All
|
@@ -436,10 +423,9 @@ boolean isIpMulticastAll() { |
|
|
* If {@code true} is used <a href="https://man7.org/linux/man-pages/man7/ip.7.html">IP_MULTICAST_ALL</a> is |
|
|
* enabled (or IPV6_MULTICAST_ALL for IPV6), {@code false} for disable it. Default is enabled. |
|
|
*/ |
|
|
EpollDatagramChannelConfig setIpMulticastAll(boolean multicastAll) { |
|
|
private void setIpMulticastAll(boolean multicastAll) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setIpMulticastAll(multicastAll); |
|
|
return this; |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
Expand All
|
@@ -453,9 +439,8 @@ EpollDatagramChannelConfig setIpMulticastAll(boolean multicastAll) { |
|
|
* {@link RecvByteBufAllocator}. You can use {@code 0} to disable the usage of recvmmsg, any other bigger value |
|
|
* will enable it. |
|
|
*/ |
|
|
EpollDatagramChannelConfig setMaxDatagramPayloadSize(int maxDatagramSize) { |
|
|
private void setMaxDatagramPayloadSize(int maxDatagramSize) { |
|
|
this.maxDatagramSize = ObjectUtil.checkPositiveOrZero(maxDatagramSize, "maxDatagramSize"); |
|
|
return this; |
|
|
} |
|
|
|
|
|
/** |
|
Expand All
|
@@ -470,14 +455,13 @@ int getMaxDatagramPayloadSize() { |
|
|
* @param gro {@code true} if {@code UDP_GRO} should be enabled, {@code false} otherwise. |
|
|
* @return this. |
|
|
*/ |
|
|
EpollDatagramChannelConfig setUdpGro(boolean gro) { |
|
|
private void setUdpGro(boolean gro) { |
|
|
try { |
|
|
((AbstractEpollChannel) channel).socket.setUdpGro(gro); |
|
|
} catch (IOException e) { |
|
|
throw new ChannelException(e); |
|
|
} |
|
|
this.gro = gro; |
|
|
return this; |
|
|
} |
|
|
|
|
|
/** |
|
Expand Down
|
|