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

UtpStream is not "Send" #5

Open
jason-ni opened this issue Feb 21, 2021 · 0 comments
Open

UtpStream is not "Send" #5

jason-ni opened this issue Feb 21, 2021 · 0 comments

Comments

@jason-ni
Copy link

Hi,

I write an example of sending message through a utp stream: jason-ni@76b93ec

However, it can not be compiled. It seems the "Send" marker is not sufficient to allow spawning a future with UtpStream. I tried to add the "Sync" marker. Then it can be compiled and run as expected. But I don't think that's the correct fix. My simple code may not be complicated enough to trigger some race condition.

Another issue is the UtpStream is hard to be split into read half and write half like tokio's TcpStream. Splitting to 2 separated halves is critical to implement a full-duplex proxy, as I understand(tokio-rs/tokio#1108).

Maybe we need to add another layer of indirection by using channel. How do you think?

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

1 participant