UIPEthernet library for Arduino IDE, Eclipse with arduino plugin and MBED/SMeshStudio (AVR,STM32F,ESP8266,Intel ARC32,Nordic nRF51,Teensy boards,Realtek Ameba(RTL8195A,RTL8710)), ENC28j60 network chip. Compatible with Wiznet W5100 Ethernet library API. Compiled and tested on Nucleo-F302R8. Master repository is: https://github.com/UIPEthernet/UIPEthernet/
Diff: examples/TcpClient/TcpClient.ino
- Revision:
- 6:f092f8b320ae
- Parent:
- 3:6b1c9bd7773a
- Child:
- 11:3fb19220d9ec
--- a/examples/TcpClient/TcpClient.ino Tue Dec 27 13:02:23 2016 +0100 +++ b/examples/TcpClient/TcpClient.ino Tue Dec 27 13:45:01 2016 +0100 @@ -61,12 +61,13 @@ LogObject.uart_send_strln(F("Client connected")); #endif client.println(F("DATA from Client")); - while(client.available()==0) + int size; + while ((client.available()==0) && (millis()<next)) { - if (next<millis()) - goto close; + #if defined(ESP8266) + wdt_reset(); + #endif } - int size; while((size = client.available()) > 0) { uint8_t* msg = (uint8_t*)malloc(size); @@ -76,7 +77,6 @@ #endif free(msg); } -close: //disconnect client #if ACTLOGLEVEL>=LOG_INFO LogObject.uart_send_strln(F("Client disconnect"));