-
Notifications
You must be signed in to change notification settings - Fork 183
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
Async TcpStream cannot send larger Amounts of Data #472
Comments
Well, after some testing I would contradict my theory of a missing event, when the send buffer is free again. I've reimplemented the given example with the |
Thank you for providing such a detailed feedback!
There are two reasons for the panics:
OK, but what can you do?
The problem with tokio is that the original contributor of the code that extended As for the |
By the way - and please don't take it as an advertisement of my own crates - I have other work to do anyways :) - you might want to give the HTTP server of |
Oh - and please use async-io-mini and edge-net directly from GIT for now. I can put updated versions of those on crates.io if there is enough interest (edge-net does have versions there, but they are old by now). |
First of all, thank you very much for being such a blessing. 😊 In the meantime, I got my own example also working with using Thank you for the explanation on the issues with |
This is so nice! |
If I have to make a guess... it is the former (insufficient
Open a bug in the
|
Looking at the |
Ah, I didn't know that there was a distinction between different event polling modes. Good to know, thank you :)
I tried to reproduce that issue on linux yesterday, already, but without "luck". However, I did not explicitly enable the poll backend. I will give that a try and see. Would you like to keep this issue open, to signal to other people, that |
I cannot reproduce it on Linux, at least not with my testcase |
You absolutely have to. It is a cfg I think that you have to pass to cargo and Rust specifically to instruct |
For my tests today, I've already enabled it :) |
I can confirm that async TCP is now working with |
Closing only because the original root cause is in |
Description
I am honestly not sure, whether this is the right place for this issue. In general, I am currently trying to find any working solution for async networking on my ESP32-S3. More specifically, I want to get an async HTTP server working.
I am aware of the
tcp_async
example that is usingasync-io
for TCP communication. However, I got a lot of different panics when trying to use it. At least in combination with an Wifi AP, I was not able to getasync-io
working for me at all. Even without networking, just trying to use the Timer did not work. Increasing the default pthread stack size helped avoiding stack overflows, but I still got other panics, iirc.I really wanted to avoid
tokio
, but when i finally tried it, it actually worked! The timer works, even TCP works. However, when I tested serving actual files over HTTP, I found that only sending very small files is possible. As soon as larger chunks of data are written to theTcpStream
, thewrite_all
call never returns. The same issue shows when limiting the call towrite_all
with a timeout and then usingwritable
to wait for the stream to become ready. The call towritable
never returns. On the client side, when requesting the file with PowerShell'sInvoke-WebRequest
tool, the download was stuck repeatedly at a specific number of bytes.Speculation
My guess is, that with sending larger amounts of data, some buffer is getting full, and that the implementation fails to send an event when the buffer is free again. But I am just not enough into the code to find a solution or even to prove, that this assumption is correct. Maybe someone else can help here?
Example
I created an example repo which shows this issue.
The text was updated successfully, but these errors were encountered: