asyncio await writer.drain() hangs forever #15591
Replies: 4 comments 3 replies
-
So I figured out it’s happens only on large amount of data (around 15 Kb), small string passes smoothly. Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
Actually, it’s not the size - it’s content of the string. If I pass 15Kb of in memory generated random symbols - they pass smoothly. What actually helped is to split the string by newline and then pass to socket string by string. But I have no idea why it working like that. |
Beta Was this translation helpful? Give feedback.
-
Is it possibly related to utf-8 / international characters in the data? What version micropython are you using? I believe there were a few issues worked on recently that related to string length calculations being thrown out by utf-8 multi-byte characters. |
Beta Was this translation helpful? Give feedback.
-
Full web server code with comments:
And output that I get (I have tried timeout up to 30 minutes - no results):
Data Im actually sending below:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I got simple web server that returns on GET request one page (about 100 lines). I’m using ESP32 as access point in this case.
Here is the code snippet of it:
Problem is it’s often just hang on writer.drain(), like this:
What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions