Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 17039c3

Browse files
authored
fix(AsyncTCP.cpp): connect() returns false if tcp_connect() fails (#184)
Using customized eModbus library don't connect due AsyncTCP::connect() allways return true
1 parent 58cbe1f commit 17039c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AsyncTCP.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,8 @@ bool AsyncClient::connect(IPAddress ip, uint16_t port){
700700
tcp_sent(pcb, &_tcp_sent);
701701
tcp_poll(pcb, &_tcp_poll, 1);
702702
//_tcp_connect(pcb, &addr, port,(tcp_connected_fn)&_s_connected);
703-
_tcp_connect(pcb, _closed_slot, &addr, port,(tcp_connected_fn)&_tcp_connected);
704-
return true;
703+
esp_err_t err = _tcp_connect(pcb, _closed_slot, &addr, port,(tcp_connected_fn)&_tcp_connected);
704+
return err == ESP_OK;
705705
}
706706

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

0 commit comments

Comments
 (0)