 
     boolean newClient = true;
     for (byte i=0;i<4;i++) {
+      //check whether this client refers to the same socket as one of the existing instances:
       if (clients[i]==client) {
         newClient = false;
         break;

    if (client.available() > 0) {
      // read the bytes incoming from the client:
      char thisChar = client.read();
      // echo the bytes back to the client:
      for (byte i=0;i<4;i++) {
        if (!clients[i] || (clients[i]==client)) {
          continue;

    }

    if (newClient) {
      //check which of the existing clients can be overridden:
      for (byte i=0;i<4;i++) {
        if (!clients[i] && clients[i]!=client) {
          clients[i] = client;
          break;
        }
