fix(AsyncTCP.cpp): connect() returns false if tcp_connect() fails (#184)

Using customized eModbus library don't connect due AsyncTCP::connect() allways return true
This commit is contained in:
jaimelaguia
2024-07-12 08:08:24 +02:00
committed by GitHub
parent 58cbe1fabe
commit 17039c38d2

View File

@@ -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){