Comments (9)
FYI... I just modified the ESPAsyncTCP.cpp and add this code and now it works:
void AsyncServer::end(){
if(_pcb){
tcp_arg(_pcb, NULL);
tcp_sent(_pcb, NULL);
tcp_recv(_pcb, NULL);
tcp_err(_pcb, NULL);
tcp_poll(_pcb, NULL, 0);
tcp_accept(_pcb, NULL);
if ( tcp_close(_pcb)!=ERR_OK ) {
//cleanup all connections?
tcp_abort(_pcb);
}
//tcp_arg(_pcb, NULL);
//tcp_accept(_pcb, NULL);
_pcb = NULL;
}
from espasyncwebserver.
the server is not made to be able to change the port currently and what you try above is also not supported. Will look into it though
from espasyncwebserver.
I used the following code and it seems to work on the first time.
std::unique_ptr server;
server.reset(new AsyncWebServer(port));
When I call server.reset(new AsyncWebServer(port)) again in the loop() to change the listen port, the ESP crashes. Do you have any idea?
from espasyncwebserver.
@anhvu100 thanks! merged into AsyncTCP
from espasyncwebserver.
@me-no-dev @anhvu100 is this function removed ?
when i do
server.reset(new AsyncWebServer(port));
i get
note: candidate expects 0 arguments, 1 provided
exit status 1
no matching function for call to 'AsyncWebServer::reset(AsyncWebServer*)'
from espasyncwebserver.
@ me-no-dev @ anhvu100 esta função foi removida?
quando
server.reset(new AsyncWebServer(port));
eu consigonote: candidate expects 0 arguments, 1 provided exit status 1 no matching function for call to 'AsyncWebServer::reset(AsyncWebServer*)'
Did you manage to solve this problem?
from espasyncwebserver.
Yes!, .... ESP32
...
std::unique_ptr server;
...
void setup() {
...
server.reset(new AsyncWebServer(new_port));
...
from espasyncwebserver.
I have the same problem, but I cannot get the above suggestions to work.
What am I doing wrong?
When I add "std::unique_ptr server;" I get an "invalid use of template name" error.
And "server.reset(new AsyncWebServer(new_port));" returns the same error that andrecortica has above.
Could someone please explain this more clearly?
from espasyncwebserver.
Look this issues:
#1058
from espasyncwebserver.
Related Issues (20)
- Change bool AsyncStaticWebHandler::canHandle to use exact match instead of String::startsWith(_uri)
- small ddos (press F5) crash: async_tcp ....watchdog got triggered HOT 2
- Compilation Error for Newer ESP32 HOT 3
- possible memory leak at send_p?
- Forwarding Webserver with websockets HOT 2
- Get new client ID at every refresh :( HOT 1
- Refusing connection when making httpGet request with mDNS
- Problem resolved ? "Arduino\libraries\ESPAsyncWebSrv\src\WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'?" HOT 10
- does not compile with ESP32C3 HOT 1
- ESP8266: Compilation error: invalid conversion from 'const AsyncWebParameter*' to 'AsyncWebParameter*' [-fpermissive] HOT 1
- IDF 5 Coexistence support HOT 5
- It is possible Increase buffer size for rx data by websocket?
- Cant set Table or Cell width % because of template processing HOT 2
- Web server hangs up HOT 1
- Why no Published Releases?
- Errors after libraries update
- Is it possible to make a Keep-Alive effect? HOT 5
- Simple example of read/write to SPIFFS HOT 2
- Best possible way of json response exceeding RAM size? Need assemble and return megabytes of nvs key contents.
- Library accessible from the Arduino IDE Lib Manager
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 espasyncwebserver.