本文介绍了RTCPeerConnection的最大数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Web浏览器对同时进行的http请求等有限制。但是,对打开的RTCPeerConnection网页可以具有的数量也有限制吗?



解决方案

不确定该限制,但是我认为大约是256(我上次听到)。我最近看到有人在单个网页上建立了200个连接(通过)。



多个RTCPeerConnection对象很棒:




  • 它们易于添加和删除,因此请提供一个加入或退出群组通话时具有更高的灵活性

  • 它们可以连接到不同的目的地



也就是说,他们有自己的挑战和开销:




  • 每个RTCPeerConnection都有自己的NAT配置-因此STUN和TURN即使RTCPeerConnection对象连接到同一实体(例如SFU),绑定和流量也会并行发生。这些开销是内存,CPU等本地资源以及网络流量中的一种(不是很大的开销,但是可以处理)


  • Chrome上的webrtc-internals视图带有多个选项卡(一个品味问题),并且SSRC之间可能具有相同的值,这使得它们很难跟踪和调试(同样,一个品味问题)




每当需要将某人添加到列表(或从列表中删除)时,单个RTCPeerConnection对象就必须重新协商所有对象。


I know web browsers have a limit on the amount of simultanous http requests etc. But is there also a limit on the amount of open RTCPeerConnection's a web page can have?

And somewhat related: RTCPeerConnection allows to send multiple streams over 1 connection. What would be the trade-offs between combining multiple streams in 1 connection or setting up multiple connections (e.g. 1 for each stream)?

解决方案

Not sure about the limit, but I think it is around 256 (last time I heard). I saw someone do 200 connections on a single web page recently (via http://testrtc.com).

Multiple RTCPeerConnection objects are great:

  • They are easy to add and remove, so offer a higher degree of flexibility when joining or leaving a group call
  • They can be connected to different destinations

That said, they have their own challenges and overheads:

  • Each RTCPeerConnection carries its own NAT configuration - so STUN and TURN bindings and traffic takes place in parallel across RTCPeerConnection objects even if they get connected to the same entity (an SFU for example). This overhead is one of local resources like memory and CPU as well as network traffic (not huge overhead, but it is there to deal with)

  • They clutter your webrtc-internals view on Chrome with multiple tabs (a matter of taste), and SSRC might have the same values between them, making them a bit harder to trace and debug (again, a matter of taste)

A single RTCPeerConnection object suffers from having to renegotiate it all whenever someone needs to be added to the list (or removed).

这篇关于RTCPeerConnection的最大数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-29 08:57