Skip to content

Commit

Permalink
EthernetClient clear cpcb on connect error
Browse files Browse the repository at this point in the history
  • Loading branch information
robertinant committed Sep 25, 2017
1 parent 1ae9340 commit 014f798
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libraries/Ethernet/EthernetClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ int EthernetClient::connect(IPAddress ip, uint16_t port, unsigned long timeout)

if (cs->cpcb->state != ESTABLISHED) {
_connected = false;
tcp_close((tcp_pcb*)cs->cpcb);
cs->cpcb = NULL;
return false;
}

/* Poll to determine if the peer is still alive */
Expand Down

0 comments on commit 014f798

Please sign in to comment.