quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Can you share snippet of code to broadcast data to client using single connection #1331

Closed vinay10949 closed 2 years ago

vinay10949 commented 2 years ago

Can you share snippet of code to broadcast data to client using single connection .

Also share Peer to Peer Comunication snippet .

Ralith commented 2 years ago

Please refer to https://github.com/quinn-rs/quinn/tree/main/quinn/examples.

vinay10949 commented 2 years ago

@Ralith Code doesnt have P2P example . can you demonstrate ,A simple P2P chat app

Ralith commented 2 years ago

QUIC requires no special measures for P2P use, just like plain UDP or TCP. Where did you get stuck?

vsawant1989 commented 2 years ago

@Ralith Basically we want broadcast data to many peers ,at the same time the peers should be able to send data to sender. The problem is with connection.We cannot use same connection for sending data to peers and recieving data from peers . Can you share short example for same

djc commented 2 years ago

QUIC does not have broadcast functionality like UDP. Like TCP, QUIC is a connection-oriented protocols where two participates set up a connection by handshaking. If you want to communicate between many peers, you'd have to set up one connection per pair of peers or use some kind of gossip protocols.

We don't just write examples on spec. If you have a well-defined problem with some code you've written we might help you troubleshoot.