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
class NioDatagramPipelineSink extends AbstractNioChannelSink
Receives downstream events from aChannelPipeline
. It contains an array of I/O workers.
-
-
Field Summary
Fields Modifier and Type Field Description private WorkerPool<NioDatagramWorker>
workerPool
-
Constructor Summary
Constructors Constructor Description NioDatagramPipelineSink(WorkerPool<NioDatagramWorker> workerPool)
Creates a newNioDatagramPipelineSink
with a the number ofNioDatagramWorker
s specified in workerCount.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
bind(NioDatagramChannel channel, ChannelFuture future, java.net.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, java.net.InetSocketAddress remoteAddress)
void
eventSunk(ChannelPipeline pipeline, ChannelEvent e)
Handle downstream event.(package private) NioDatagramWorker
nextWorker()
-
Methods inherited from class org.jboss.netty.channel.socket.nio.AbstractNioChannelSink
execute, isFireExceptionCaughtLater
-
Methods inherited from class org.jboss.netty.channel.AbstractChannelSink
exceptionCaught
-
-
-
-
Field Detail
-
workerPool
private final WorkerPool<NioDatagramWorker> workerPool
-
-
Constructor Detail
-
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 Detail
-
eventSunk
public void eventSunk(ChannelPipeline pipeline, ChannelEvent e) throws java.lang.Exception
Handle downstream event.- Parameters:
pipeline
- theChannelPipeline
that passes down the downstream event.e
- The downstream event.- Throws:
java.lang.Exception
-
close
private static void close(NioDatagramChannel channel, ChannelFuture future)
-
bind
private static void bind(NioDatagramChannel channel, ChannelFuture future, java.net.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, java.net.InetSocketAddress remoteAddress)
-
nextWorker
NioDatagramWorker nextWorker()
-
-