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

The README claims to be async,, but socket does not implement AsyncRead neither AsyncWrite #4

Closed
feelingnothing opened this issue Apr 24, 2022 · 4 comments

Comments

@feelingnothing
Copy link

To use this socket within codecs in tokio utility crate, the socket must implement AsyncRead and AsyncWrite. Is this possible to implement?

@b23r0
Copy link
Owner

b23r0 commented Apr 24, 2022

I may implement the two traits AsyncRead and AsyncWrite in the next version. If you are interested in participating in the development, you can also submit a PR for your needs.

@feelingnothing
Copy link
Author

Cool, waiting for new release, I guess I don't even have to wait for release on crate.io because I already use git dependency due to strange hivemc raknet implementation. Hope for the fast fix for this, because I can't see the point of using it without Async[Read|Write] because all async api's require these traits anyways for comfortable usage. I like how codecs work in tokio-util, but this issue really stopping me from using library

@b23r0
Copy link
Owner

b23r0 commented Apr 29, 2022

I have committed AsyncRead and AsyncWrite support for RaknetSocket in the main branch.
I will officially release it to crates.io in the next version. You can already test it by integrating the git repository.
If you have any problems, you can continue to file an issue. If there are no problems I will close this issue in the near future.

@b23r0
Copy link
Owner

b23r0 commented Apr 29, 2022

A note on some AsyncRead implementations.

/// Note: AsyncRead requires you to provide a fixed-size buffer for reading data.
/// 
/// However, Raknet is not a streaming protocol, so when you use AsyncRead, if you don't provide enough buffer size (less than Raknet Packet size), then a Raknet Packet will be split into multiple reads.
/// 
/// This will lead to a similar TCP unpacking problem when you use AsyncRead when you are developing scenarios such as Raknet reverse proxy where the packet size cannot be predicted.
/// https://programmer.ink/think/tcp-packet-sticking-unpacking.html
/// So it is not recommended to use AsyncRead for developing Raknet reverse proxy.
/// 

@b23r0 b23r0 closed this as completed May 1, 2022
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