Index: webrtc/p2p/base/p2ptransportchannel.cc |
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc |
index 1eb63c5e69577269d7f0a8783a37c640246d337f..f1dbdaf907f823673d08de16444526c40e84ceb6 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.cc |
+++ b/webrtc/p2p/base/p2ptransportchannel.cc |
@@ -154,6 +154,11 @@ void P2PTransportChannel::AddConnection(Connection* connection) { |
this, &P2PTransportChannel::OnConnectionDestroyed); |
connection->SignalNominated.connect(this, &P2PTransportChannel::OnNominated); |
had_connection_ = true; |
+ if (!started_pinging_) { |
+ // Start checking and pinging as soon as we have the first connection. |
+ thread()->Post(RTC_FROM_HERE, this, MSG_CHECK_AND_PING); |
honghaiz3
2016/06/27 16:24:20
Should we worry about that the first connection ma
pthatcher1
2016/06/27 18:32:20
It's true that we need to make sure we have the re
Taylor Brandstetter
2016/06/27 22:19:34
Great observation, Honghai. I was only thinking ab
|
+ started_pinging_ = true; |
honghaiz3
2016/06/27 16:24:20
The two variables had_connection_ and started_ping
pthatcher1
2016/06/27 18:32:20
I won't any more if we check that we have the remo
Taylor Brandstetter
2016/06/27 22:19:34
Peter is correct.
|
+ } |
} |
// Determines whether we should switch the selected connection to |
@@ -352,21 +357,10 @@ const IceConfig& P2PTransportChannel::config() const { |
return config_; |
} |
-// Go into the state of processing candidates, and running in general |
-void P2PTransportChannel::Connect() { |
- ASSERT(worker_thread_ == rtc::Thread::Current()); |
+void P2PTransportChannel::MaybeStartGathering() { |
if (ice_ufrag_.empty() || ice_pwd_.empty()) { |
- ASSERT(false); |
- LOG(LS_ERROR) << "P2PTransportChannel::Connect: The ice_ufrag_ and the " |
- << "ice_pwd_ are not set."; |
return; |
} |
- |
- // Start checking and pinging as the ports come in. |
- thread()->Post(RTC_FROM_HERE, this, MSG_CHECK_AND_PING); |
-} |
- |
-void P2PTransportChannel::MaybeStartGathering() { |
// Start gathering if we never started before, or if an ICE restart occurred. |
if (allocator_sessions_.empty() || |
IceCredentialsChanged(allocator_sessions_.back()->ice_ufrag(), |