Ethercard get request issue

Hi Everyone,

I got the ethercard ethernet library to mostly work. I’m having a sporadic issue that is driving me crazy and I was wondering if anyone would have any insight into resolving this issue.

So I basically send the data to my online server and then spin for a while afterwards.

ether.browseUrl("/api/OnlineData.php?", "get=event=Wireless&data=SensorData HTTP/1.1", "www.mycompany.com", my_callback);

  timer = millis();
  notSent = false;
  while (notSent == false && (millis() - timer < 5000)) {
    ether.packetLoop(ether.packetReceive());
    delay(50);
  }

A successful request returns the following:

<<< REQ >>>
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Tue, 26 Mar 2019 20:15:14 GMT
Server: Apache
Content-Length: 0
Connection: keep-alive

Unfortunately after a handful of requests, I stop getting this response and the while loop just times out.

Has anyone else come across this issue?

For anyone else experiencing this issue. I found out that my AWS server has a 60sec timeout. Add a DNSLookup to fix this issue.

As traffic to your application changes over time, Elastic Load Balancing scales your load balancer and updates the DNS entry. Note that the DNS entry also specifies the time-to-live (TTL) as 60 seconds, which ensures that the IP addresses can be remapped quickly in response to changing traffic.

You can set an idle timeout value for both Application Load Balancers and Classic Load Balancers. The default value is 60 seconds. With an Application Load Balancer, the idle timeout value applies only to front-end connections.