@Override
	public void run() {
		MessageFromTablet messageFromTabletAux = null;
		MessageFromTablet lightsOffMessageFromTabletAux = null;
		gson = new Gson();
		log.log("Hijo - Thread lanzado con éxito");
		try {
			in = new BufferedReader(new InputStreamReader(
					tabletSocket.getInputStream()));
			out = new BufferedWriter(new PrintWriter(
					tabletSocket.getOutputStream()));
			while (true) {
				// Reads data
				messageFromTabletAux = readData(tabletSocket);
				if (messageFromTabletAux == null) break;
				listener.msgPipe(this, messageFromTabletAux);
				if (messageFromTabletAux.getAction() == TabletActions.ENVIAR_COMPLETA) {
					try {
						log.log("Hijo - Thread " + messageFromTabletAux.getColor() + " se encuentra en Stand By");
						Thread.sleep(DELAY_BETWEEN_GAMES);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					lightsOffMessageFromTabletAux = new MessageFromTablet();
					lightsOffMessageFromTabletAux.setAction(TabletActions.APAGA_LLUMS);
					lightsOffMessageFromTabletAux.setColor(messageFromTabletAux.getColor());
					listener.msgPipe(this, lightsOffMessageFromTabletAux);
				}
				// Gives data to the main thread
			}

		} catch (IOException e) {
			log.log(e.getStackTrace());
		} catch ( NullPointerException e2 ) {
			log.log(e2.getStackTrace());
		}
	}