Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XAsyncTCPServerException: OnClientAccepted event: timeoutSec is incorrect to set timeout expire #74

Open
meghadeep-com opened this issue Sep 20, 2021 · 2 comments

Comments

@meghadeep-com
Copy link

meghadeep-com commented Sep 20, 2021

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:
image

@meghadeep-com
Copy link
Author

meghadeep-com commented Sep 20, 2021

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
image

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.

@xlla
Copy link

xlla commented Nov 22, 2021

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 by 
Traceback (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants