MicroWebSrv2
MicroWebSrv2 copied to clipboard
XAsyncTCPServerException: OnClientAccepted event: timeoutSec is incorrect to set timeout expire
There's a weird issue with timeoutSec that's happening on every new connection.
This is my code:
from MicroWebSrv2 import *
mws2 = MicroWebSrv2()
mws2.StartManaged(parllProcCount=1, procStackSize=4)
@WebRoute(GET, '/data-test')
def dataSend(microWebSrv2, request):
request.Response.ReturnOk(None)
@WebRoute(GET, '/data')
def dataSend(microWebSrv2, request):
request.Response.ReturnOk(ujson.dumps(payload_maker()))
#request.Response.ReturnOkJSON(payload_maker())
This is the error I am getting:

I tried this dirty thing:
def _setExpireTimeout(self, timeoutSec) :
try :
if timeoutSec and timeoutSec > 0 :
self._expireTimeSec = perf_counter() + timeoutSec
except :
self._expireTimeSec = perf_counter() + 3
# raise XAsyncSocketException('"timeoutSec" is incorrect to set expire timeout.')
But it raises yet another

This happens any time I try to send a GET request to one of the routes. I have changed the regex routing rule already to accommodate for ESP32.
save problem here on esp32 board,
>>> mws2.StartManaged(procStackSize=4*1024) MWS2-INFO> Server listening on 0.0.0.0:80. MWS2-INFO> Starts the managed pool to wait for I/O events. >>> Unhandled exception in thread started byTraceback (most recent call last): File "MicroWebSrv2/libs/XAsyncSockets.py", line 131, in _processWaitEvents File "MicroWebSrv2/libs/XAsyncSockets.py", line 425, in OnReadyForReading XAsyncTCPServerException: Error when handling the "OnClientAccepted" event : "timeoutSec" is incorrect to set expire timeout.