protected InternelListener makeAcceptInternelListener(
			final ConnectedListener listener) {
		return new InternelListener() {
			@Override
			public void notifyListener(final SelectionKey key) {
				// temporary ignore the selection
				key.interestOps(key.interestOps() ^ SelectionKey.OP_ACCEPT);

				// accept
				// get the server socket
				ServerSocketChannel server = (ServerSocketChannel) key
						.channel();

				// find connected channels
				try {
					SocketChannel channel;
					while ((channel = server.accept()) != null) {
						try {
							// make it final for anonymous function
							final SocketChannel final_channel = NIO.this
									.tuneSocketChannel(channel);

							// register it
							// synchronous each time instead of once
							// synchronized.
							// avoid long process which holds the selector too
							// long
							synchronized (NIO.this.selector.wakeup()) {
								final_channel
										.register(
												NIO.this.selector,
												SelectionKey.OP_READ,
												NIO.this.makeReadableInternelListener(listener));
							}

							// notify connected
							NIO.this.asyncs.offer(new Runnable() {
								@Override
								public void run() {
									// notify connection from remote
									try {
										listener.notifyConnected(final_channel);
									} catch (Exception e) {
										NIO.LOGGER.error(
												"fail to notify connected,cancel key:"
														+ key, e);
										NIO.this.cancelAndNotify(key, listener);
									}
								}
							});
						} catch (Exception e) {
							NIO.LOGGER.error(
									"fail to process remote channel,cancel it:"
											+ key, e);
							NIO.this.cancelAndNotify(key, listener);
						}
					}
				} catch (IOException e) {
					NIO.LOGGER.error(
							"fail when accepted channel cancel accept of key:"
									+ key, e);
					NIO.this.cancelAndNotify(key, listener);
				}

				// re attach
				NIO.this.restoreKeyOrCancle(key, SelectionKey.OP_ACCEPT);
			}
		};
	}