What is the best practice for making a single socket address accessible to each websocket connection? #7673
Unanswered
ShovelJockey
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using an axum websocket setup with the on_update func binding to a tokio::net::Udpsocket reading rtp video data that is formatted and send to the connected webrtc client.
From some testing my current setup would introduce an error on a second connection as the addr/port is already bound.
What is the best practice for having multiple readers/recievers to the same addr/port? Figured it might work to wrap the struct in a arc/mutex passed either as state or in a oncelock static or maybe as a task where the socket is read and then the data is written to a channel?
Would appreciate suggestions for best practice usage.
Beta Was this translation helpful? Give feedback.
All reactions