public void ready() {
		if (!selectionKey.isValid()) {
			return;
		}

		// Service the request.
		try {
			if (selectionKey.isAcceptable()) {
				RequestHandler.serveAccept(this);
			}
			if (selectionKey.isReadable()) {
				RequestHandler.serveRead(this);
			}
			if (selectionKey.isWritable()) {
				RequestHandler.serveWrite(this);
			}
		} catch (Exception ex) {
			ex.printStackTrace();
			disconnect();
		}
	}