// if there's incoming data from the net connection. // send it out the serial port. This is for debugging // purposes only: if (client.available()) { char c = client.read(); Serial.print(c); }

// if there's no net connection, but there was one last time // through the loop, then stop the client: if (!client.connected() && lastConnected) { client.stop(); }

// if you're not connected, and ten seconds have passed since // your last connection, then connect again and send data: if(!client.connected() && (millis() - lastConnectionTime > postingInterval)) { sendData(); } // store the state of the connection for next time through // the loop: lastConnected = client.connected();}