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 newNioDatagramPipelineSinkwith a the number ofNioDatagramWorkers specified in workerCount.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static voidbind(NioDatagramChannel channel, ChannelFuture future, java.net.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, java.net.InetSocketAddress remoteAddress)voideventSunk(ChannelPipeline pipeline, ChannelEvent e)Handle downstream event.(package private) NioDatagramWorkernextWorker()-
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 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 Detail
-
eventSunk
public void eventSunk(ChannelPipeline pipeline, ChannelEvent e) throws java.lang.Exception
Handle downstream event.- Parameters:
pipeline- theChannelPipelinethat 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()
-
-