Skip to content

how to access tcpstream in different tasks #4059

Answered by Darksonn
ActivePeter asked this question in Q&A
Discussion options

You must be logged in to vote

Do not put the socket behind a mutex. For simple use-cases, you can use the split or into_split methods on the socket. For more complicated sharing, a common alternative is to use the actor pattern.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ActivePeter
Comment options

Answer selected by Darksonn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants