Index: webrtc/p2p/base/session.cc |
diff --git a/webrtc/p2p/base/session.cc b/webrtc/p2p/base/session.cc |
index 55b1d90c1a811563a69f9793ae04fff1f6886054..d7a8625307c71bf0ce7adae665415f263e84f1fc 100644 |
--- a/webrtc/p2p/base/session.cc |
+++ b/webrtc/p2p/base/session.cc |
@@ -344,7 +344,8 @@ BaseSession::BaseSession(rtc::Thread* signaling_thread, |
identity_(NULL), |
ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10), |
ice_tiebreaker_(rtc::CreateRandomId64()), |
- role_switch_(false) { |
+ role_switch_(false), |
+ ice_receiving_timeout_(-1) { |
ASSERT(signaling_thread->IsCurrent()); |
} |
@@ -477,6 +478,16 @@ bool BaseSession::PushdownRemoteTransportDescription( |
return true; |
} |
+void BaseSession::SetIceConnectionReceivingTimeout(int timeout_ms) { |
+ ice_receiving_timeout_ = timeout_ms; |
+ for (const auto& kv : transport_proxies()) { |
+ Transport* transport = kv.second->impl(); |
+ if (transport) { |
+ transport->SetChannelReceivingTimeout(timeout_ms); |
+ } |
+ } |
+} |
+ |
TransportChannel* BaseSession::CreateChannel(const std::string& content_name, |
int component) { |
// We create the proxy "on demand" here because we need to support |
@@ -566,12 +577,13 @@ void BaseSession::DestroyTransportProxy( |
} |
} |
-cricket::Transport* BaseSession::CreateTransport( |
- const std::string& content_name) { |
+Transport* BaseSession::CreateTransport(const std::string& content_name) { |
ASSERT(transport_type_ == NS_GINGLE_P2P); |
- return new cricket::DtlsTransport<P2PTransport>( |
- signaling_thread(), worker_thread(), content_name, |
- port_allocator(), identity_); |
+ Transport* transport = new DtlsTransport<P2PTransport>( |
+ signaling_thread(), worker_thread(), content_name, port_allocator(), |
+ identity_); |
+ transport->SetChannelReceivingTimeout(ice_receiving_timeout_); |
+ return transport; |
} |
void BaseSession::SetState(State state) { |