WebRTC Native M96收集网卡地址信息以及筛选过滤VPN网络(CreateNetworks、FilterNetworks)

网络类型很多,比如网线、WIFI、蜂窝网络、VPN、LOOPBACK等等。
那么WebRTC在连接的时候,就可以对网络进行筛选,尤其是对于多网卡,多种连接方式的设备。

CreateNetworks的调用流程

WebRTC 收集网卡信息的时机

线程: signaling thread

PeerConnection::SetLocalDescription  
SdpOfferAnswerHandler::SetLocalDescription  
SdpOfferAnswerHandler::DoSetLocalDescription (transport_controller()->MaybeStartGathering();)  
JsepTransportController::MaybeStartGathering()  
void JsepTransportController::MaybeStartGathering() {
  if (!network_thread_->IsCurrent()) {
    network_thread_->Invoke<void>(RTC_FROM_HERE,
                                  [&] { MaybeStartGathering(); });
    return;
  }

  for (auto& dtls : GetDtlsTransports()) {
    dtls->ice_transport()->MaybeStartGathering();
  }
}

线程: network thread

JsepTransportController::MaybeStartGathering()
P2PTransportChannel::MaybeS

猜你喜欢

转载自blog.csdn.net/wangshubo1989/article/details/125750487