ENC28j60 module and UNO Problem

Hello to all.
First sorry because I don't have good access to the Internet.
I've connected ENC28j60 to uno r3.Everything is OK just this problem.
When I want to create delay between HTTP request and HTTP response , and When I send one request to uno r3 by 'GET' mothod,I get more than one request in uno.
I just need one request in my code.If somebody could solve my problem,Thank you.
I have attached My code and Picture of my problem in below.
Thanks again.

void loop() {
  word len = ether.packetReceive();
  word pos = ether.packetLoop(len);
  
  if(pos) {
    Serial.println((char *)Ethernet::buffer + pos);
    if(strstr((char *)Ethernet::buffer + pos, "GET /?status=ON") != 0) { 
    }
    if(strstr((char *)Ethernet::buffer + pos, "GET /?status=OFF") != 0) {
    }

               delay(1000);

    BufferFiller bfill = ether.tcpOffset();
    bfill.emit_p(PSTR("HTTP/1.0 200 OK\r\n"
      "Content-Type: text/html\r\nPragma: no-cache\r\n\r\n"
      "<html><head><title>WebLed</title></head></html>"));
    ether.httpServerReply(bfill.position());
    
  }
}

Attachs.zip (190 KB)

Sorry so much, I don't have access to the internet , So I am waiting here, Please don't forget me.
Thanks again.

Nobody has any idea.?:(| !

You need to look at what EACH step in that code does.

    BufferFiller bfill = ether.tcpOffset();
    bfill.emit_p(PSTR("HTTP/1.0 200 OK\r\n"
      "Content-Type: text/html\r\nPragma: no-cache\r\n\r\n"
      "<html><head><title>WebLed</title></head></html>"));

This is code acting as a server. It makes no sense to have this code if you are trying to make GET requests.

If the GET requests are coming from somewhere else (a browser), then this code does belong there. That's a pretty skimpy page, though. It is missing a form where the action buttons would be, so expecting GET requests after serving up that page doesn't make sense.

    ether.httpServerReply(bfill.position());

This gets the response from the client, after the above page is sent. Doing something with the data in bfill AFTER this call makes sense. Doing it BEFORE this call does not.

Nobody has any idea.?

Since you clearly don't know anything about clients and servers, get the right kind of ethernet shield that handles more of the work for you.

Thanks.But I want to know why when I'm using 'delay(1000)' in my program , it occurs?:frowning:

But I want to know why when I'm using 'delay(1000)' in my program

You typed the code. You tell us why you typed delay(1000); there.

Yes you're right , but this is not my answer.???
Somebody else?:frowning: