@Override
	public void handleEvent() {
		LogManager.getLogger(LoggingHandler.class).info("handle event");
		if (socket.isConnected()) {

			if (dst.position() > 0) {
				try {
					pipe.write(dst);
					dst.compact();
					if (dst.position() != 0) {
						LogManager.getLogger(LoggingHandler.class).log(
								Level.ERROR, "head wrote not enought");
						return;
					} else {
						LogManager.getLogger(LoggingHandler.class).log(
								Level.ERROR, "remaining data wrote!");
					}
				} catch (IOException e) {
					e.printStackTrace();
				}
				LogManager.getLogger(LoggingHandler.class).log(Level.ERROR,
						"wrote not enought");
				return;
			}

			process();
			try {
				int readed, wrote;
				while ((readed = socket.read(dst)) != 0) {
					if (readed > 0) {
						if (readed < dst.capacity()) {
							dst.put(System.lineSeparator().getBytes());
						}
						dst.flip();
						wrote = pipe.write(dst);
						dst.compact();
						if (dst.position() != 0) {
							LogManager.getLogger(LoggingHandler.class).log(
									Level.ERROR, "wrote not enought");
							break;
						}
						LogManager
								.getLogger(LoggingHandler.class)
								.log(Level.INFO,
										"log handler reads {} from {}, wrote {}, remaining {}",
										readed, socket.socket().getPort(),
										wrote, dst.position());
					} else {
						LogManager.getLogger(LoggingHandler.class).log(
								Level.INFO, "log handler reads {} from {}",
								readed, socket.socket().getLocalPort());
						closeConnection();
						return;
					}
				}
			} catch (IOException e) {
				LogManager.getLogger(LoggingHandler.class).error("run", e);
			}
		} else {
			LogManager.getLogger(LoggingHandler.class).error(
					"socket is not connected");
			closeConnection();
			return;
		}
		// if (R.USE_EXECUTORS) {
		// try {
		// dispatcher.register(this, SelectionKey.OP_READ);
		// } catch (ClosedChannelException e) {
		// e.printStackTrace();
		// }
		// }
	}