Can Arduino-as-Server accept a second request from an already connected client?

I'm pretty clueless about client/server things. But I have a project going where my Uno has an Ethernet Shield attached, acts as a server and responds to a client request by blinking a random sequence of LED lights. Right now it receives the request, blinks the lights, and then closes the connection. Would it be possible to alter my sketch so it: 1) receives the client request, 2) reads a value the client has sent, 3) keeps the connection open and does nothing (or at least does not blink the lights) until the client sends a SECOND request and then 4) blinks the light sequence closes the connection? This second request would happen immediately after the first.

What my question comes down to, I guess, is whether or not the Arduino-as-Server can accept a second request from a client while a previous connection with that same client is still open. AND recognize that the second request is different in that it's not passing in a value.

This setup might sound nutty, but it has to do with the limitations of the Android project my Arduino is interacting with.

If you think I should post this question in the networking thread, just let me know and I will do. Thanks.

Any chance you could post your code so we can see how you're doing what you've done so far?

Sure. It’s just a very slightly changed version of the provided Web Server sketch:

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

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xF7, 0x99 };
IPAddress ip(192,168,2,3);

EthernetServer server(80);

String roundOpenTag = "<one>";
String roundCloseTag = "</one>"; 
long randNumber;
String ledColor = "";
int seqArray[5] = {3,5,6,7,8};

void setup()
{
  pinMode(8, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(3, OUTPUT);
  Ethernet.begin(mac, ip);
  server.begin();
}

void loop()
{
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) 
    {
      boolean currentLineIsBlank = true;
      while (client.connected()) 
        {
          if (client.available()) 
            {
              char c = client.read();
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a repl
        
              if (c == '\n' && currentLineIsBlank) 
                {
                  
          // send a standard http response header
                  client.println("HTTP/1.1 200 OK");
                  client.println("Content-Type: text/html");
                  client.println();
                  delay(1000);
                          for (int i = 0; i < 5; i++)
                            {
                              randomSeed(analogRead(1));
                              randNumber = random(0, 5);
                              
                              if (randNumber == 0)
                              {
                                 ledColor = "red"; 
                              }
                              else if (randNumber == 1)
                              {
                                  ledColor = "orange";
                              }
                               else if (randNumber == 2)
                              {
                                  ledColor = "yellow";
                              }
                               else if (randNumber == 3)
                              {
                                  ledColor = "green";
                              }
                               else
                              {
                                  ledColor = "blue";
                              }
                              digitalWrite(seqArray[randNumber], HIGH);// set the LED on
                              delay(275);  
                              client.print(roundOpenTag);
                              client.print(ledColor + "
");
                              digitalWrite(seqArray[randNumber], LOW);
                              delay(275); 
                              client.print(roundCloseTag);                              
                            }
                            break;
                    }
                    if (c == '\n') 
                    {
                      // you're starting a new line
                      currentLineIsBlank = true;
                    } 
                    else if (c != '\r') 
                    {
                      // you've gotten a character on the current line
                      currentLineIsBlank = false;
                    }
            }
        }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
  }
}

Sure you can handle multiple requests. So instead of closing the connection to let the client know that you've sent it the full response, send a chunked body and don't close the connection.

http://en.m.wikipedia.org/wiki/Chunked_transfer_encoding

3) keeps the connection open and does nothing (or at least does not blink the lights) until the client sends a SECOND request and then 4) blinks the light sequence closes the connection? This second request would happen immediately after the first.

Telnet keeps a connection open. Does your android support telnet client connections? If you are actually lmited to the android being a web browser client, then you might need to set a flag on the arduino with the first android connection, then do some action on the second android connection.