Can you help me understand the connection cycle in mediasoup?
I have successfully practiced creating a server using express.js, socket.io, and mediasoup. However, I am a bit confused about how to detect a disconnection from mediasoup.
The questions are:
- Does the transport close immediately when socket.io is disconnected? Can it not be reconnected?
- When is the right time to use restart ice connection?
- Provide me with references to understand RTP mux and CoMedia. To comprehend how they work and their functions.
- Is the mind map I created correct? I’m a bit confused about pipe transport because I haven’t tried it yet, but that’s how I imagine it.? Connectivity
Sir, I created mindmap like this Mediasoup Mindmap and what you think? Is it true?
Looks ok, the main point is that if you don’t have producer on your worker, which you want to consume, you must get it from that worker to this worker using pipetransport, which you have mentioned in diagram. Rest depends upon the app logic
In the context of a media server, connections won’t be automatically closed for any reason; their state will persist until cleared. To determine if a user has finished using the connection, you can employ a chat server. This chat server can monitor changes in their activity using methods like ping/pong (if no pong is received on the second round, the connection can be closed), detecting when the socket is closed, or responding to a server request to terminate the connection.
pipeTransports can get complicated, a media-broker-server is an ideal solution, queue each message received till job is completed. This means if a broadcast comes in, this server will tell mediaserver-A and mediaserver-B to create and connect their transports and then produce/consume the stream. When done complete next job, this prevents global variable state from being untrue at any point.