Class NioDatagramPipelineSink
java.lang.Object
org.jboss.netty.channel.AbstractChannelSink
org.jboss.netty.channel.socket.nio.AbstractNioChannelSink
org.jboss.netty.channel.socket.nio.NioDatagramPipelineSink
- All Implemented Interfaces:
ChannelSink
Receives downstream events from a
ChannelPipeline
. It contains
an array of I/O workers.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNioDatagramPipelineSink
(WorkerPool<NioDatagramWorker> workerPool) Creates a newNioDatagramPipelineSink
with a the number ofNioDatagramWorker
s specified in workerCount. -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
bind
(NioDatagramChannel channel, ChannelFuture future, InetSocketAddress address) Will bind the DatagramSocket to the passed-in address.private static void
close
(NioDatagramChannel channel, ChannelFuture future) private static void
connect
(NioDatagramChannel channel, ChannelFuture future, InetSocketAddress remoteAddress) void
eventSunk
(ChannelPipeline pipeline, ChannelEvent e) Handle downstream event.(package private) NioDatagramWorker
Methods inherited from class org.jboss.netty.channel.socket.nio.AbstractNioChannelSink
execute, isFireExceptionCaughtLater
Methods inherited from class org.jboss.netty.channel.AbstractChannelSink
exceptionCaught
-
Field Details
-
workerPool
-
-
Constructor Details
-
NioDatagramPipelineSink
NioDatagramPipelineSink(WorkerPool<NioDatagramWorker> workerPool) Creates a newNioDatagramPipelineSink
with a the number ofNioDatagramWorker
s specified in workerCount. TheNioDatagramWorker
s take care of reading and writing for theNioDatagramChannel
.- Parameters:
workerExecutor
- theExecutor
that will run theNioDatagramWorker
s for this sinkworkerCount
- the number ofNioDatagramWorker
s for this sink
-
-
Method Details
-
eventSunk
Handle downstream event.- Parameters:
pipeline
- theChannelPipeline
that passes down the downstream event.e
- The downstream event.- Throws:
Exception
-
close
-
bind
private static void bind(NioDatagramChannel channel, ChannelFuture future, InetSocketAddress address) Will bind the DatagramSocket to the passed-in address. Every call bind will spawn a new thread using the that basically in turn -
connect
private static void connect(NioDatagramChannel channel, ChannelFuture future, InetSocketAddress remoteAddress) -
nextWorker
NioDatagramWorker nextWorker()
-