1、多端口介绍
mediasoup中的多端口,指服务端对每个客户端都会开辟新的端口来监听,这样就会导致服务端同时暴露成百上千个端口,
实际生产环境肯定是不行的。
2、srs4.0 单端口连接管理介绍
srs中通过SrsRtcConnection来代表一个连接。注意这个SrsRtcConnection 并不代表一个发布者订阅者。
具体见:
// The RTC server instance, listen UDP port, handle UDP packet, manage RTC connections.
class SrsRtcServer : virtual public ISrsUdpMuxHandler, virtual public ISrsHourGlass
{
private:
SrsHourGlass* timer;
std::vector<SrsUdpMuxListener*> listeners;
ISrsRtcServerHandler* handler;
ISrsRtcServerHijacker* hijacker;
private:
// TODO: FIXME: Rename it.
std::map<std::string, SrsRtcConnection*> map_username_session; // key: username(local_ufrag + ":" + remot
本文介绍了mediasoup服务端如何处理多端口问题,以及SRS 4.0的单端口连接管理策略。通过SrsRtcConnection对象管理连接,使用SSRC和stream id来区分发布者和播放者,同时讲解了STUN包如何用于链接关联。在服务器级联场景下,IP和端口无法唯一标识发布者或播放者,而SSRC成为关键标识符。
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



