Skip to content

Commit 42f4f71

Browse files
committed
Revert "Deprecate the old close(bool) call"
This reverts commit 7a1bc54.
1 parent 7a1bc54 commit 42f4f71

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

examples/Client/Client.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void makeRequest() {
3131

3232
client->onError([](void *arg, AsyncClient *client, int8_t error) {
3333
Serial.printf("** error occurred %s \n", client->errorToString(error));
34-
client->close();
34+
client->close(true);
3535
delete client;
3636
});
3737

@@ -41,7 +41,7 @@ void makeRequest() {
4141

4242
client->onDisconnect([](void *arg, AsyncClient *client) {
4343
Serial.printf("** client has been disconnected: %" PRIu16 "\n", client->localPort());
44-
client->close();
44+
client->close(true);
4545
delete client;
4646

4747
permits++;

idf_component_examples/client/main/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void makeRequest() {
2828

2929
client->onError([](void *arg, AsyncClient *client, int8_t error) {
3030
Serial.printf("** error occurred %s \n", client->errorToString(error));
31-
client->close();
31+
client->close(true);
3232
delete client;
3333
client_running = false;
3434
});
@@ -38,7 +38,7 @@ void makeRequest() {
3838

3939
client->onDisconnect([](void *arg, AsyncClient *client) {
4040
Serial.printf("** client has been disconnected: %" PRIu16 "\n", client->localPort());
41-
client->close();
41+
client->close(true);
4242
delete client;
4343
client_running = false;
4444
});

src/AsyncTCP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ bool AsyncClient::connect(const char *host, uint16_t port) {
921921
return false;
922922
}
923923

924-
void AsyncClient::close() {
924+
void AsyncClient::close(bool now) {
925925
if (_pcb) {
926926
_tcp_recved(&_pcb, _rx_ack_len);
927927
}

src/AsyncTCP.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,26 +99,16 @@ class AsyncClient {
9999
#endif
100100
#endif
101101
bool connect(const char *host, uint16_t port);
102-
103102
/**
104103
* @brief close connection
105104
*
106105
* @param now - ignored
107106
*/
108-
[[deprecated("Use AsyncClient::close() instead")]]
109-
void close(bool now) {
110-
close();
111-
}
112-
[[deprecated("Use AsyncClient::close() instead")]]
107+
void close(bool now = false);
108+
// same as close()
113109
void stop() {
114-
close();
110+
close(false);
115111
};
116-
117-
/**
118-
* @brief close connection
119-
*/
120-
void close();
121-
122112
int8_t abort();
123113
bool free();
124114

0 commit comments

Comments
 (0)