Skip to content

Commit

Permalink
fix(AsyncTCP.cpp): connect() returns false if tcp_connect() fails (#184)
Browse files Browse the repository at this point in the history
Using customized eModbus library don't connect due AsyncTCP::connect() allways return true
  • Loading branch information
jaimelaguia authored Jul 12, 2024
1 parent 58cbe1f commit 17039c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AsyncTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,8 @@ bool AsyncClient::connect(IPAddress ip, uint16_t port){
tcp_sent(pcb, &_tcp_sent);
tcp_poll(pcb, &_tcp_poll, 1);
//_tcp_connect(pcb, &addr, port,(tcp_connected_fn)&_s_connected);
_tcp_connect(pcb, _closed_slot, &addr, port,(tcp_connected_fn)&_tcp_connected);
return true;
esp_err_t err = _tcp_connect(pcb, _closed_slot, &addr, port,(tcp_connected_fn)&_tcp_connected);
return err == ESP_OK;
}

bool AsyncClient::connect(const char* host, uint16_t port){
Expand Down

0 comments on commit 17039c3

Please sign in to comment.