Hi,
I am sending a HTTP with "Connection: close" request:
client.println("GET http://www.google.com.au/ HTTP/1.1"); // note, the google address is not the real one
client.println("Connection: close");
client.println();
I get a reply that the server acknowledge it:
HTTP/1.1 200 OK
Date: Mon, 04 Aug 2014 05:57:35 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=c7372cf97f6b7a33:FF=0:TM=1407131855:LM=1407131855:S=ivf0-SM_bxoycH8J; expires=Wed, 03-Aug-2016 05:57:35 GMT; path=/; domain=.google.com.au
Set-Cookie: NID=67=Khn-N2-2ORq6_9hmPCkpXKWskUWbNEXE3UNsX87sveVkOsBfGwEDPU-Y50NmRfKV9JWy-jf5q_sgwGUf36UivdQY_gNUiFaETyExB69pqCt3VXDiZ_7oO1KUHnqx_c2R; expires=Tue, 03-Feb-2015 05:57:35 GMT; path=/; domain=.google.com.au; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 80:quic
Connection: close
But the code that need to pick it up, doesn't and the stay in endless loop:
void loop() {
if (client.available()) {
char c = client.read();
Serial.print(c);
}
if (!client.connected()) {
Serial.println("disconnecting");
client.stop();
delay(2000);
while(true);
}
}
Does the Ardiuno have a problem to close the connection?