Comments (2)
I'm totally lost:
I changed _close():
int8_t AsyncClient::_close(){
//ets_printf("X: 0x%08x\n", (uint32_t)this);
int8_t err = ERR_OK;
if(_pcb) {
//log_i("");
tcp_arg(_pcb, NULL);
tcp_sent(_pcb, NULL);
tcp_recv(_pcb, NULL);
tcp_err(_pcb, NULL);
tcp_poll(_pcb, NULL, 0);
_tcp_clear_events(this);
if(_in_lwip_thread){
err = tcp_close(_pcb);
} else {
err = _tcp_close(_pcb);
}
if(err != ERR_OK) {
err = abort();
}
_pcb = NULL;
if(_discard_cb) {
log_i("calling onDisconnect");
_discard_cb(_discard_cb_arg, this);
}
}
return err;
}
Now the output is
[W][AsyncTCP.cpp:631] _poll(): rx timeout 4
[I][AsyncTCP.cpp:543] _close(): calling onDisconnect
but onDisconnect is not called!
When it is preceeded by an ack timeout, it does work:
[W][AsyncTCP.cpp:624] _poll(): ack timeout 4
[W][AsyncTCP.cpp:631] _poll(): rx timeout 4
[I][AsyncTCP.cpp:543] _close(): calling onDisconnect
[I][MqttConnect.cpp:123] _onMqttDisconnected(): MQTT disconnected
from asynctcp.
Turns out, AsyncMqttClient only calls onDisconnect when it receives a disconnect confirmation from the broker and not when it is just disconnected by lwip.
(apologies for the non-issue)
from asynctcp.
Related Issues (20)
- error: AsyncTCP.h: No such file or directory HOT 1
- Examples from ESPAsyncTCP and update to Readme HOT 1
- Crash on multiple async reqs HOT 47
- [FR] Project Examples for PlatformIO Registry HOT 1
- espcam stream with TCP and receive UDP packets at same time HOT 1
- [FR] Project Examples for PlatformIO Registry
- Examples for the AsyncTCP HOT 1
- [ 32449][E][AsyncTCP.cpp:1313] begin(): failed to start task
- How to use the reply from onData
- AsyncTCP Conversion issue
- How to pause receiving uploads from client HOT 1
- any chance this will be published under a permissive license (e.g. Apache, MIT, MPL) HOT 6
- .pio/libdeps/esp32doit-devkit-v1/AsyncTCP/src/AsyncTCP.cpp:85:8: : 'xQueueHandle' does not name a type; HOT 2
- [FR] Project Examples for PlatformIO Registry
- Install HOT 1
- ESP32 - WLED Unhandled Exception on MQTT Connection HOT 1
- fatal error: sdkconfig.h: No such file or directory
- Problem when connecting via WIFIAP HOT 2
- AsyncUDP is conflicting with AsyncTCP
- How am I supposed to use AsyncTCP? Examples please!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asynctcp.