@Override
	public void run() {
		while (!stop) {
			try {
				processUbindQ();
				processRegQ();
				processFlushQ();
				int count = this.selector.select(TIME_OUT);
				if (count == 0) {
					if (this.selector.selectedKeys().size() > 0) {
						this.selector.selectedKeys().clear();
					}
					continue;
				}
				Set<SelectionKey> ready = selector.selectedKeys();
				Iterator<SelectionKey> iterator = ready.iterator();
				while (iterator.hasNext()) {
					SelectionKey key = iterator.next();
					iterator.remove();
					try {
						ChannelHandlerContext ctx = this.map.get(key);
						ChannelHandler handler = ctx.getHandler();
						try {
							handler.read(ctx);
						} catch (Exception e) {
							e.printStackTrace();
							handler.close(ctx);
						}
					} catch (Exception e) {
						e.printStackTrace();
						key.cancel();
						key.channel().close();
					}

				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}