Fix issues with NetworkMonitor singleton when used by multiple clients.
When you create multiple "PeerConnectionFactory"s, they end up using the same NetworkMonitor singleton. But the second one's "AndroidNetworkMonitor" class (in C++) wasn't getting the expected network list update, and as a result it wasn't binding sockets to networks successfully, acting as if the networks didn't exist. The solution is just to move "updateActiveNetworkList" to "startMonitoring". This CL also does some other minor cleanup/refactoring, and fixes a more corner-casey issue where, if the first PeerConnection is destroyed, the second one would stop receiving network updates. BUG=webrtc:7946 Review-Url: https://codereview.webrtc.org/2990693002 Cr-Commit-Position: refs/heads/master@{#19156}
This commit is contained in:
@ -65,6 +65,7 @@ class AndroidNetworkMonitor : public rtc::NetworkMonitorBase,
|
||||
rtc::AdapterType GetAdapterType(const std::string& if_name) override;
|
||||
void OnNetworkConnected(const NetworkInformation& network_info);
|
||||
void OnNetworkDisconnected(NetworkHandle network_handle);
|
||||
// Always expected to be called on the network thread.
|
||||
void SetNetworkInfos(const std::vector<NetworkInformation>& network_infos);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user