Can return to switch

hello, iam programing a switch case with some rgb blinking and normal leds, my problem is when i wanna turn on another color, my device cant return to switch and keep blinking.
this is the code:

#include <SPI.h>
#include <Ethernet.h>
#include <MFRC522.h>

byte mac[] = {0x90, 0xA2, 0xDA, 0x0D, 0x6B, 0xC4};
byte server[] = { 192, 168, 0, 107};
byte ip[] = {192, 168, 0, 120};

#define RST_PIN 2 // Configurable, see typical pin layout above
#define SS_PIN 6 // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
MFRC522::MIFARE_Key key;

EthernetClient client;

void setup() {
Ethernet.begin(mac,ip);
Serial.begin(9600);
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card

// Prepare the key (used both as key A and as key B)
// using FFFFFFFFFFFFh which is the default at chip delivery from the factory
for (byte i = 0; i < 6; i++) {
key.keyByte = 0xFF;

  • }*

  • dump_byte_array(key.keyByte, MFRC522::MF_KEY_SIZE);*

  • pinMode(5, OUTPUT);*

  • pinMode(3, OUTPUT);*

  • pinMode(9, OUTPUT);*

  • pinMode(7, OUTPUT);*

  • pinMode(8, OUTPUT);*

  • Serial.println("connecting...");*

  • conectar();*
    }
    void loop() {

  • if (!client.connected()) {*

  • Serial.println();*

  • Serial.println("disconnecting.");*

  • client.stop();*

  • conectar();*

  • }*

  • if (client.available()) {*

  • char c = client.read();*

  • Serial.print(c);*

  • switch (c) {*

  • case '1' :*

  • analogWrite(3, 0);*

  • analogWrite(5, 255);*

  • analogWrite(9, 0);*

  • client.println("verde");*

  • break;*

  • case '2':*

  • analogWrite(3, 255);*

  • analogWrite(5, 30);*

  • analogWrite(9, 0);*

  • client.println("naranja");*

  • break;*

  • case '3':*

  • analogWrite(3, 255);*

  • analogWrite(5, 0);*

  • analogWrite(9, 0);*

  • client.println("rojo");*

  • break;*

  • case '4':*

  • do{*

  • analogWrite(3, 0);*

  • analogWrite(5, 255);*

  • analogWrite(9, 0);*

  • delay(1000);*

  • analogWrite(3, 0);*

  • analogWrite(5, 0);*

  • analogWrite(9, 0);*

  • delay(1000);*

  • if(c=='7') break;*

  • }while(1);*

  • client.println("verde");*

  • break;*

  • case '5':*

  • for(;;){*

  • analogWrite(3, 255);*

  • analogWrite(5, 30);*

  • analogWrite(9, 0);*

  • delay(1000);*

  • analogWrite(3, 0);*

  • analogWrite(5, 0);*

  • analogWrite(9, 0);*

  • delay(1000);*

  • }*

  • client.println("naranja");*

  • break;*

  • case '6':*

  • do {*

  • analogWrite(3, 255);*

  • analogWrite(5, 0);*

  • analogWrite(9, 0);*

  • delay(1000);*

  • analogWrite(3, 0);*

  • analogWrite(5, 0);*

  • analogWrite(9, 0);*

  • delay(1000);*

  • } while (c == '6');*

  • c = client.read();*

  • client.println("rojo");*

  • break;*

  • case '7':*

  • analogWrite(3, 0);*

  • analogWrite(5, 0);*

  • analogWrite(9, 0);*

  • delay(1000);*

  • c = '4';*

  • client.println("Apagado");*

  • break;*

  • case '8':*

  • digitalWrite(8, HIGH);*

  • digitalWrite(7, LOW);*

  • delay(1000);*

  • digitalWrite(8, LOW);*

  • client.println("abierto");*

  • break;*

  • case '9':*

  • digitalWrite(8, LOW);*

  • digitalWrite(7, HIGH);*

  • delay(1000);*

  • digitalWrite(7, LOW);*

  • client.println("cerrado");*

  • break;*

  • default:*

  • break;*

  • }*

  • }*

  • start_reading();*
    }
    void conectar() {

  • if (client.connect(server, 8194)) {*

  • Serial.println("connected");*

  • client.println();*

  • } else {*

  • Serial.println("connection failed");*

  • }*
    }
    void start_reading() {

  • if ( ! mfrc522.PICC_IsNewCardPresent())*

  • return;*

  • // Select one of the cards*

  • if ( ! mfrc522.PICC_ReadCardSerial())*

  • return;*

  • // Show some details of the PICC (that is: the tag/card)*

  • //Serial.print(F("Card UID:"));*

  • //Imprime id de rfid*

  • dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);*

  • Serial.println();*

  • // Halt PICC*

  • mfrc522.PICC_HaltA();*

  • // Stop encryption on PCD*

  • mfrc522.PCD_StopCrypto1();*
    }
    void dump_byte_array(byte *buffer, byte bufferSize) {

  • for (byte i = 0; i < bufferSize; i++) {*
    _ Serial.print(buffer < 0x10 ? " 0" : " ");_
    _ Serial.print(buffer*, HEX);
    client.print(buffer < 0x10 ? " 0" : " ");
    client.print(buffer, HEX);
    }
    }*_

but this case keep running infinite...
case '4':
do{
analogWrite(3, 0);
analogWrite(5, 255);
analogWrite(9, 0);
delay(1000);
analogWrite(3, 0);
analogWrite(5, 0);
analogWrite(9, 0);
delay(1000);
if(c=='7') break;
}while(1);
client.println("verde");

break;

Yeah bro, i understand the problem here is: i need keep running blink infinite and with a command stop the blink, how can i stop the blink with a command? i cant find the way.

i wanna do something like this:
case '4':
do {
if (client.read() == NULL) {
analogWrite(3, 0);
analogWrite(5, 255);
analogWrite(9, 0);
delay(1000);
analogWrite(3, 0);
analogWrite(5, 0);
analogWrite(9, 0);
delay(1000);
}
else
break;
} while (1);
client.println("verde");

break;

how can i compare if client is getting strings?

Please read the two posts by Nick Gammon at the top of this Forum, especially about the use of code tags when presenting source code listings in your post. If you don't your code may get mangled. You should also use Crtl-T in the IDE to reformat your code before you copy it to your post.