Package com.automation_pros.odva.encap
Class NettyUdpDispatch
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- com.automation_pros.odva.encap.NettyUdpDispatch
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class NettyUdpDispatch extends io.netty.channel.ChannelInboundHandlerAdapter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
NettyUdpDispatch.BcastResponder
protected static class
NettyUdpDispatch.BcastSetup
protected class
NettyUdpDispatch.DelayedWriter
-
Field Summary
Fields Modifier and Type Field Description protected static io.netty.channel.EventLoopGroup
bcastWorker
Null checks and writes to static bcastWorker must be controlled by synchronization on senders.io.netty.channel.socket.DatagramChannel
chan
TcpIpPort
owner
protected java.util.Random
rdelay
static java.util.List<NettyUdpDispatch>
senders
protected static org.slf4j.Logger
sLogger
-
Constructor Summary
Constructors Constructor Description NettyUdpDispatch(TcpIpPort owner, io.netty.channel.socket.DatagramChannel chan)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<NettyUdpDispatch>
activeSenders()
void
channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg)
void
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)
boolean
processPacket(java.net.InetSocketAddress peer, Encap packet, boolean check, boolean delay)
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Field Detail
-
sLogger
protected static org.slf4j.Logger sLogger
-
senders
public static final java.util.List<NettyUdpDispatch> senders
-
bcastWorker
protected static io.netty.channel.EventLoopGroup bcastWorker
Null checks and writes to static bcastWorker must be controlled by synchronization on senders.
-
rdelay
protected final java.util.Random rdelay
-
owner
public final TcpIpPort owner
-
chan
public final io.netty.channel.socket.DatagramChannel chan
-
-
Constructor Detail
-
NettyUdpDispatch
public NettyUdpDispatch(TcpIpPort owner, io.netty.channel.socket.DatagramChannel chan)
-
-
Method Detail
-
activeSenders
public static java.util.List<NettyUdpDispatch> activeSenders()
-
processPacket
public boolean processPacket(java.net.InetSocketAddress peer, Encap packet, boolean check, boolean delay)
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
java.lang.Exception
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelHandler
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
exceptionCaught
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
java.lang.Exception
-
-