public MessageFromTablet readData(Socket tabletSocket) {
		int numBytesRecv = 0;
		MessageFromTablet messageFromTabletAux = null;
		String inputLine = new String();
		bRecv = new char[BUFFER_LENGTH];
		try {
			sb = new StringBuffer(); // Buffer where concatenate Strings
										// received
			while ((numBytesRecv = in.read(bRecv)) == BUFFER_LENGTH) {
				sb.append(bRecv);
			}
			if (numBytesRecv != -1)
				sb.append(bRecv, 0, numBytesRecv);
		
			inputLine = sb.toString();
			
			log.log("Hijo - Mensaje recibido:\n" + inputLine);
			// Deserialize the String received
			messageFromTabletAux = gson.fromJson(inputLine,
					MessageFromTablet.class);
			idTablet = messageFromTabletAux.getColor();
			log.log("Hijo - Mensaje deserializado correctamente:");
			log.log(messageFromTabletAux.toString());
			return messageFromTabletAux;
		} catch (IOException e) {
			MessageFromTablet byeByeFromTablet = new MessageFromTablet();
			byeByeFromTablet.setColor(idTablet);
			byeByeFromTablet.setAction(TabletActions.ERROR);
			listener.msgPipe(this, byeByeFromTablet);
			log.log("Hijo - Error en readData()");
			log.log(e.getStackTrace());
			try {
				log.log("Hijo - Cerrando streams/socket.");
				if (in != null)
					in.close();
				if (out != null)
					out.close();
				if (tabletSocket != null)
					tabletSocket.close();
			} catch (IOException e1) {
				log.log("Hijo - Error cerrando streams/socket");
				e1.printStackTrace();
				System.exit(0);
				return null;
			}
			
		} catch ( NullPointerException e2) {
			log.log("Hijo - NullPointerException, cerrando socket.");
			log.log(e2.getStackTrace());
			return null;
		}
		return	messageFromTabletAux;
	}