is it more reliable to send_data to the whole room...
# ask-ai
k
is it more reliable to send_data to the whole room, to one specific participant in a room, or are they the same?
t
Thanks for reaching out, Ethan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Let's chat about how reliable
send_data
is in LiveKit, depending on how you send and who you send it to: • Reliable Delivery: This makes sure your messages arrive in order and retries if something gets lost. It’s perfect for important stuff like chat messages. • Lossy Delivery: Sends messages without retrying, which works great for things that need to be super quick, like updating game positions in real time. When it comes to who you’re sending to: • Whole Room: Great for reaching everyone at once, but keep in mind it might use more network resources and could lead to some packet loss if you’re using lossy mode. • Specific Participants: Helps keep things efficient by sending only to certain people, making sure your message gets where it’s supposed to go—but you’ll need to keep track of who’s who. One important thing to remember: LiveKit doesn’t hold onto messages on the server. So, if someone’s disconnected for a bit, they might miss out on some data. That’s why it’s a good idea to pick reliable delivery for anything critical and lossy delivery when you need fast, real-time updates, depending on what your app needs. Sources: packages/livekit-server-sdk/src/RoomServiceClient.ts | Data messages | LiveKit Docs | Android SDK | livekit/livekit_composite | DeepWiki