OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2132 } | 2132 } |
2133 | 2133 |
2134 bool PeerConnection::InitializePortAllocator_n( | 2134 bool PeerConnection::InitializePortAllocator_n( |
2135 const RTCConfiguration& configuration) { | 2135 const RTCConfiguration& configuration) { |
2136 cricket::ServerAddresses stun_servers; | 2136 cricket::ServerAddresses stun_servers; |
2137 std::vector<cricket::RelayServerConfig> turn_servers; | 2137 std::vector<cricket::RelayServerConfig> turn_servers; |
2138 if (!ParseIceServers(configuration.servers, &stun_servers, &turn_servers)) { | 2138 if (!ParseIceServers(configuration.servers, &stun_servers, &turn_servers)) { |
2139 return false; | 2139 return false; |
2140 } | 2140 } |
2141 | 2141 |
| 2142 port_allocator_->Initialize(); |
| 2143 |
2142 // To handle both internal and externally created port allocator, we will | 2144 // To handle both internal and externally created port allocator, we will |
2143 // enable BUNDLE here. | 2145 // enable BUNDLE here. |
2144 int portallocator_flags = port_allocator_->flags(); | 2146 int portallocator_flags = port_allocator_->flags(); |
2145 portallocator_flags |= cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET | | 2147 portallocator_flags |= cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET | |
2146 cricket::PORTALLOCATOR_ENABLE_IPV6; | 2148 cricket::PORTALLOCATOR_ENABLE_IPV6; |
2147 // If the disable-IPv6 flag was specified, we'll not override it | 2149 // If the disable-IPv6 flag was specified, we'll not override it |
2148 // by experiment. | 2150 // by experiment. |
2149 if (configuration.disable_ipv6) { | 2151 if (configuration.disable_ipv6) { |
2150 portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6); | 2152 portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6); |
2151 } else if (webrtc::field_trial::FindFullName("WebRTC-IPv6Default") == | 2153 } else if (webrtc::field_trial::FindFullName("WebRTC-IPv6Default") == |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2187 port_allocator_->set_candidate_filter( | 2189 port_allocator_->set_candidate_filter( |
2188 ConvertIceTransportTypeToCandidateFilter(configuration.type)); | 2190 ConvertIceTransportTypeToCandidateFilter(configuration.type)); |
2189 // Call this last since it may create pooled allocator sessions using the | 2191 // Call this last since it may create pooled allocator sessions using the |
2190 // candidate filter set above. | 2192 // candidate filter set above. |
2191 port_allocator_->SetConfiguration(stun_servers, turn_servers, | 2193 port_allocator_->SetConfiguration(stun_servers, turn_servers, |
2192 configuration.ice_candidate_pool_size); | 2194 configuration.ice_candidate_pool_size); |
2193 return true; | 2195 return true; |
2194 } | 2196 } |
2195 | 2197 |
2196 } // namespace webrtc | 2198 } // namespace webrtc |
OLD | NEW |