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

TcpStream::try_clone() -> Function not implemented (os error 88) #328

Closed
victorbnl opened this issue Jul 23, 2024 · 2 comments
Closed

TcpStream::try_clone() -> Function not implemented (os error 88) #328

victorbnl opened this issue Jul 23, 2024 · 2 comments

Comments

@victorbnl
Copy link

victorbnl commented Jul 23, 2024

Attempting to run try_clone() on a TcpStream results in the following error.

Os { code: 88, kind: Unsupported, message: "Function not implemented" }

In my use case, this makes it impossible to use Apache Thrift on my ESP32. Is it more of an issue with the Rust ESP toolchain not supporting cloning TCP streams, or with Apache Thrift not supporting platforms which don’t support it?

Here is a minimal reproducible example: https://github.com/victorbnl/esp-rs-tcpstream-clone-88

@ivmarkov
Copy link
Collaborator

ivmarkov commented Sep 15, 2024

Sorry for reacting so late.
try_clone is unlikely to be implemented anytime soon, as there's a missing functionality in ESP-IDF itself: it does not support the Posix dup syscall. In other words, it cannot "duplicate" a file/socket handle. This also means we cannot support try_clone, as after try_clone you should end up with two separate TCP streams which have their own lifetime, but for that, we absolutely need dup. :)

@ivmarkov
Copy link
Collaborator

If you feel like contributing a dup support to ESP-IDF, implementing TCP stream try_clone would be a piece of cake afterwards.

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

No branches or pull requests

2 participants