PicoMite RP2040: V6.00.00 betas


Author Message
Malibu
Senior Member

Joined: 07/07/2018
Location: Australia
Posts: 261
Posted: 10:36pm 21 Sep 2024      

Peter, I think there's one more niggling problem with the WebMite and Watchdogs...

It's been pretty stable, but occasionaly I've had some random resets - so I had another play with your code to see what I could learn.
IF I hit reload/stop/reload/stop, etc etc reasonably fast in the browser, effectively I create multiple HTML requests for the webmite, but before it can answer, the client disappears, so there's no client to send a web page to (As I suspect is what's happening with some of the 'bot' traffic I've seen)
Eventually, I get a "No free connections" error because all the connection slots are used, and soon enough the watchdog fires.
So, I changed some of the MMtcpServer.c code
//if(pcb==MaxPcb)error("No free connections");
if(pcb==MaxPcb)printf("Warning: No free connections\r\n");

just to see what happens...
The resulting error lines in MMCC
  Quote  Warning: LWIP send data timeout connection no. 1
Warning: No response to request from connection no. 3
Warning: No free connections
Warning: LWIP send data timeout connection no. 2
Warning: No response to request from connection no. 5
Warning: No response to request from connection no. 6
Warning: No response to request from connection no. 7
Warning: No response to request from connection no. 8
Warning: No response to request from connection no. 1
Warning: No free connections
Warning: LWIP send data timeout connection no. 4

The no connections error is still present, but it doesn't fire the watchdog and eventually recovers.
Is it possible to have the WM ignore any new requests once the connection max has been reached (or until it has time to clean up the already open connections)?
My way of thinking is to keep the server running no matter what, and if the client loses connection or doesn't get answered, it's not the servers problem.
Any thoughts on that one?  

(This is still using the 5.09.00RC5 version of the source code)