@Override
	public void run() {
		// convert the rxPacket's payload to a string
		String payload = new String(rxPacket.getData(), 0, rxPacket.getLength()).trim();

		// dispatch request handler functions based on the payload's prefix
		
		if (payload.startsWith("REGISTER")) {
			onRegisterRequested(payload.
					substring("REGISTER".length() + 1, payload.length()).trim());
			return;
		}
		
		if (payload.startsWith("JOIN")) {
			onJoinRequested(payload.
					substring("JOIN".length() + 1, payload.length()).trim());
			return;
		}
		
		if (payload.startsWith("SEND")) {
			onSendRequested(payload.
					substring("SEND".length() + 1, payload.length()).trim());
			return;
		}
		
		if (payload.startsWith("POLL")) {
			onPollRequested(payload.
					substring("POLL".length() + 1, payload.length()).trim());
			return;
		}

		if (payload.startsWith("ACK")) {
			onAckRequested(payload.
					substring("ACK".length() + 1, payload.length()).trim());
			return;
		}

		if (payload.startsWith("SHUTDOWN")) {
			onShutdownRequested();
			return;
		}

		// if we got here, it must have been a bad request, so we tell the
		// client about it
		onBadRequest();
	}