private void mainClientLoop () throws IOException, UnmatchedTypeException, PacketValidator.InvalidPacketException {
		Object decoded = ValueDecoder.decodeRootObjectFromStream(socketInput);
		if (decoded == null) {
			throw new UnmatchedTypeException("Decoded object was null");
		}
		if (decoded instanceof Map) {
			PacketValidator validator = new PacketValidator((Map<?, ?>)decoded);
			validator.validateGeneralPacket();

			@SuppressWarnings("unchecked")
			Map<String, ?> packetInfo = (Map<String, ?>)decoded;

			if (packetInfo.get("type").equals("data")) {
				clientSentData(packetInfo);
			} else if (packetInfo.get("type").equals("auth")) {
				clientSentAuthToken((ByteBuffer)packetInfo.get("token"));
			}
		} else {
			throw new UnmatchedTypeException("Invalid class for client packet: " + decoded.getClass());
		}
	}