Code example for Selector

Methods: wakeup

0
 
	public void shutdown() 
	{ 
		dispatching = false;
 
		selector.wakeup();
	} 
 
	public ChannelFacade registerChannel (SelectableChannel channel, InputHandler handler)
		throws IOException 
	{ 
		channel.configureBlocking (false);
 
		HandlerAdapter adapter = new HandlerAdapter (handler, this, bufferFactory);
 
		adapter.registering();
 
		acquireSelectorGuard(); 
 
		try { 
			SelectionKey key = channel.register (selector, SelectionKey.OP_READ, adapter);