user59320: i'm noob in coding i try to make some led blink ( with succes ) and now i would like to add http request to change delay. 
i have no error compiling the code but it dont work any idea ? 
Thanks 
 include SPI.h
 include Ethernet.h

unsigned long maxTime = 4000;


EthernetServer arduinoServer(81);
EthernetServer httpServer(80);

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 8, 60);

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);

////CODE IS 11001010
int led1 = 6;  // = 0
int led2 = 7;  // = 1 


void setup() {
  Serial.begin(9600);

  // Setup the 3 pins as OUTPUT
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);


  // You can use Ethernet.init(pin) to configure the CS pin
  //Ethernet.init(10);  // Most Arduino shields
  //Ethernet.init(5);   // MKR ETH shield
  //Ethernet.init(0);   // Teensy 2.0
  //Ethernet.init(20);  // Teensy++ 2.0
  //Ethernet.init(15);  // ESP8266 with Adafruit Featherwing Ethernet
  //Ethernet.init(33);  // ESP32 with Adafruit Featherwing Ethernet

  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.println("Ethernet WebServer Example");

  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);

  // Check for Ethernet hardware present
  if (Ethernet.hardwareStatus() == EthernetNoHardware) {
    Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    while (true) {
      delay(1); // do nothing, no point running without Ethernet hardware
    }
  }
  if (Ethernet.linkStatus() == LinkOFF) {
    Serial.println("Ethernet cable is not connected.");
  }

  // start the server
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());

}

void loop() 
{
  digitalWrite(led1, LOW);
  digitalWrite(led2, HIGH);
  delay(maxTime);
  digitalWrite(led2, LOW);
  delay(maxTime);
  digitalWrite(led1, LOW);
  digitalWrite(led2, HIGH);
  delay(maxTime);
   digitalWrite(led1, HIGH);
   digitalWrite(led2, LOW);
  delay(maxTime);
  digitalWrite(led1, LOW);
   delay(maxTime);

   digitalWrite(led1, HIGH);
   digitalWrite(led2, LOW);
  delay(maxTime);
   digitalWrite(led1, LOW);
   digitalWrite(led2, HIGH);
  delay(maxTime);
   digitalWrite(led1, HIGH);
   digitalWrite(led2, LOW);
  delay(maxTime);
   digitalWrite(led1, LOW);
   digitalWrite(led2, HIGH);
  delay(maxTime);
   digitalWrite(led1, HIGH);
   digitalWrite(led2, LOW);
  delay(maxTime);
     digitalWrite(led1, LOW);
   digitalWrite(led2, LOW);
  delay(5000);



 // listen for incoming clients
}

void receiveHttpRequest() {
  EthernetClient client = httpServer.available();
  String requestInputString;
  boolean resetArduino = false;
  boolean forceSolved = false;
  client.setConnectionTimeout(50);

  if (client)
  {
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    boolean firstLine = true;
    requestInputString = String("");
    while (client.connected())
    {
      if (client.available())
      {
        char c = client.read();
        if (firstLine)
        {
          requestInputString += String(c);
        }
        Serial.write(c);
        // 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 reply
        if (c == '\n' && currentLineIsBlank)
        {

          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close"); // the connection will be closed after completion of the response
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html><body>");

            int newMaxTime = requestInputString.substring(20).toInt();
            if (newMaxTime < 2000) {
              newMaxTime = 2000;
            }

            maxTime = newMaxTime;

            client.print(String("New maxTime is: "));
            client.println(maxTime);
          }
        }
      }
    }
  }


user359: Inside delay() no other code can run. Which also means that no clients can be serviced.
Change that delay-laden function to a state machine mirroring blinkWithoutDelay. 
That is you test if(millis() - previousTimestamp < delay) and if true progress to the next state in your blinks and update previousTimestamp. 
After that if you call receiveHttpRequest() to see if any clients are waiting and process the input.

59320: <p>i'm noob in coding i try to make some led blink ( with succes ) and now i would like to add http request to change delay. </p>

<p>i have no error compiling the code but it dont work any idea ? </p>

<p>Thanks </p>

<pre><code> include SPI.h
 include Ethernet.h

unsigned long maxTime = 4000;


EthernetServer arduinoServer(81);
EthernetServer httpServer(80);

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 8, 60);

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);

////CODE IS 11001010
int led1 = 6;  // = 0
int led2 = 7;  // = 1 


void setup() {
  Serial.begin(9600);

  // Setup the 3 pins as OUTPUT
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);


  // You can use Ethernet.init(pin) to configure the CS pin
  //Ethernet.init(10);  // Most Arduino shields
  //Ethernet.init(5);   // MKR ETH shield
  //Ethernet.init(0);   // Teensy 2.0
  //Ethernet.init(20);  // Teensy++ 2.0
  //Ethernet.init(15);  // ESP8266 with Adafruit Featherwing Ethernet
  //Ethernet.init(33);  // ESP32 with Adafruit Featherwing Ethernet

  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.println("Ethernet WebServer Example");

  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);

  // Check for Ethernet hardware present
  if (Ethernet.hardwareStatus() == EthernetNoHardware) {
    Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    while (true) {
      delay(1); // do nothing, no point running without Ethernet hardware
    }
  }
  if (Ethernet.linkStatus() == LinkOFF) {
    Serial.println("Ethernet cable is not connected.");
  }

  // start the server
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());

}

void loop() 
{
  digitalWrite(led1, LOW);
  digitalWrite(led2, HIGH);
  delay(maxTime);
  digitalWrite(led2, LOW);
  delay(maxTime);
  digitalWrite(led1, LOW);
  digitalWrite(led2, HIGH);
  delay(maxTime);
   digitalWrite(led1, HIGH);
   digitalWrite(led2, LOW);
  delay(maxTime);
  digitalWrite(led1, LOW);
   delay(maxTime);

   digitalWrite(led1, HIGH);
   digitalWrite(led2, LOW);
  delay(maxTime);
   digitalWrite(led1, LOW);
   digitalWrite(led2, HIGH);
  delay(maxTime);
   digitalWrite(led1, HIGH);
   digitalWrite(led2, LOW);
  delay(maxTime);
   digitalWrite(led1, LOW);
   digitalWrite(led2, HIGH);
  delay(maxTime);
   digitalWrite(led1, HIGH);
   digitalWrite(led2, LOW);
  delay(maxTime);
     digitalWrite(led1, LOW);
   digitalWrite(led2, LOW);
  delay(5000);



 // listen for incoming clients
}

void receiveHttpRequest() {
  EthernetClient client = httpServer.available();
  String requestInputString;
  boolean resetArduino = false;
  boolean forceSolved = false;
  client.setConnectionTimeout(50);

  if (client)
  {
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    boolean firstLine = true;
    requestInputString = String("");
    while (client.connected())
    {
      if (client.available())
      {
        char c = client.read();
        if (firstLine)
        {
          requestInputString += String(c);
        }
        Serial.write(c);
        // 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 reply
        if (c == '\n' &amp;&amp; currentLineIsBlank)
        {

          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close"); // the connection will be closed after completion of the response
          client.println();
          client.println("&lt;!DOCTYPE HTML&gt;");
          client.println("&lt;html&gt;&lt;body&gt;");

            int newMaxTime = requestInputString.substring(20).toInt();
            if (newMaxTime &lt; 2000) {
              newMaxTime = 2000;
            }

            maxTime = newMaxTime;

            client.print(String("New maxTime is: "));
            client.println(maxTime);
          }
        }
      }
    }
  }
</code></pre>
 359: <p>Inside <code>delay()</code> no other code can run. Which also means that no clients can be serviced.</p>

<p>Change that delay-laden function to a state machine mirroring blinkWithoutDelay. </p>

<p>That is you test <code>if(millis() - previousTimestamp &lt; delay)</code> and if true progress to the next state in your blinks and update <code>previousTimestamp</code>. </p>

<p>After that <code>if</code> you call <code>receiveHttpRequest()</code> to see if any clients are waiting and process the input.</p>
