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 newNioDatagramPipelineSinkwith a the number ofNioDatagramWorkers specified in workerCount. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidbind(NioDatagramChannel channel, ChannelFuture future, InetSocketAddress address) Will bind the DatagramSocket to the passed-in address.private static voidclose(NioDatagramChannel channel, ChannelFuture future) private static voidconnect(NioDatagramChannel channel, ChannelFuture future, InetSocketAddress remoteAddress) voideventSunk(ChannelPipeline pipeline, ChannelEvent e) Handle downstream event.(package private) NioDatagramWorkerMethods inherited from class org.jboss.netty.channel.socket.nio.AbstractNioChannelSink
execute, isFireExceptionCaughtLaterMethods inherited from class org.jboss.netty.channel.AbstractChannelSink
exceptionCaught
-
Field Details
-
workerPool
-
-
Constructor Details
-
NioDatagramPipelineSink
NioDatagramPipelineSink(WorkerPool<NioDatagramWorker> workerPool) Creates a newNioDatagramPipelineSinkwith a the number ofNioDatagramWorkers specified in workerCount. TheNioDatagramWorkers take care of reading and writing for theNioDatagramChannel.- Parameters:
workerExecutor- theExecutorthat will run theNioDatagramWorkers for this sinkworkerCount- the number ofNioDatagramWorkers for this sink
-
-
Method Details
-
eventSunk
Handle downstream event.- Parameters:
pipeline- theChannelPipelinethat 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()
-