Skip to content

Commit

Permalink
Remove goto
Browse files Browse the repository at this point in the history
  • Loading branch information
cassy73 authored Dec 27, 2016
1 parent d17041a commit e0fa0c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/TcpClient/TcpClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ void loop() {
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);
Expand All @@ -76,7 +77,6 @@ void loop() {
#endif
free(msg);
}
close:
//disconnect client
#if ACTLOGLEVEL>=LOG_INFO
LogObject.uart_send_strln(F("Client disconnect"));
Expand Down

0 comments on commit e0fa0c4

Please sign in to comment.