private void handleSelectionKey(final SelectionKey key) throws IOException
	{
		if (key.isAcceptable()) // a connection was made, so add the handler
		{
			final ServerSocketChannel server = (ServerSocketChannel) key.channel();
			final SocketChannel channel = server.accept();
			if (channel != null)
			{
				HTTPIOHandler handler;
				if(servChannels.get(server).booleanValue())
					handler=new HTTPSReader(this, channel, sslContext);
				else
					handler=new HTTPReader(this, channel);
				channel.configureBlocking (false);
				channel.register (servSelector, SelectionKey.OP_READ, handler);
				synchronized(handlers) // synched because you can't iterate and modify, and because its a linkedlist
				{
					handlers.add(handler);
				}
			}
		}
		if(key.isReadable() // bytes were received on one of the channel .. so read!
		|| (((key.interestOps() & SelectionKey.OP_WRITE)==SelectionKey.OP_WRITE) && key.isWritable()))
		{
			final HTTPIOHandler handler = (HTTPIOHandler)key.attachment();
			//config.getLogger().finer("Read/Write: "+handler.getName());
			if(!handler.isCloseable())
			{
				key.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE);
				executor.execute(handler);
			}
		}
		else
		if(key.attachment() instanceof HTTPIOHandler)
		{
			final HTTPIOHandler handler = (HTTPIOHandler)key.attachment();
			config.getLogger().finer("Rejected handler key for "+handler.getName());
		}
	}