OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 AddTurnServers(udp_turn, tcp_turn); | 185 AddTurnServers(udp_turn, tcp_turn); |
186 } | 186 } |
187 | 187 |
188 void AddTurnServers(const rtc::SocketAddress& udp_turn, | 188 void AddTurnServers(const rtc::SocketAddress& udp_turn, |
189 const rtc::SocketAddress& tcp_turn) { | 189 const rtc::SocketAddress& tcp_turn) { |
190 RelayServerConfig turn_server(RELAY_TURN); | 190 RelayServerConfig turn_server(RELAY_TURN); |
191 RelayCredentials credentials(kTurnUsername, kTurnPassword); | 191 RelayCredentials credentials(kTurnUsername, kTurnPassword); |
192 turn_server.credentials = credentials; | 192 turn_server.credentials = credentials; |
193 | 193 |
194 if (!udp_turn.IsNil()) { | 194 if (!udp_turn.IsNil()) { |
195 turn_server.ports.push_back(ProtocolAddress(udp_turn, PROTO_UDP, false)); | 195 turn_server.ports.push_back(ProtocolAddress(udp_turn, PROTO_UDP)); |
196 } | 196 } |
197 if (!tcp_turn.IsNil()) { | 197 if (!tcp_turn.IsNil()) { |
198 turn_server.ports.push_back(ProtocolAddress(tcp_turn, PROTO_TCP, false)); | 198 turn_server.ports.push_back(ProtocolAddress(tcp_turn, PROTO_TCP)); |
199 } | 199 } |
200 allocator_->AddTurnServer(turn_server); | 200 allocator_->AddTurnServer(turn_server); |
201 } | 201 } |
202 | 202 |
203 bool CreateSession(int component) { | 203 bool CreateSession(int component) { |
204 session_ = CreateSession("session", component); | 204 session_ = CreateSession("session", component); |
205 if (!session_) { | 205 if (!session_) { |
206 return false; | 206 return false; |
207 } | 207 } |
208 return true; | 208 return true; |
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 // handling the unresolved address signal from TurnPort. | 1442 // handling the unresolved address signal from TurnPort. |
1443 TEST_F(BasicPortAllocatorTest, TestSharedSocketWithServerAddressResolve) { | 1443 TEST_F(BasicPortAllocatorTest, TestSharedSocketWithServerAddressResolve) { |
1444 turn_server_.AddInternalSocket(rtc::SocketAddress("127.0.0.1", 3478), | 1444 turn_server_.AddInternalSocket(rtc::SocketAddress("127.0.0.1", 3478), |
1445 PROTO_UDP); | 1445 PROTO_UDP); |
1446 AddInterface(kClientAddr); | 1446 AddInterface(kClientAddr); |
1447 allocator_.reset(new BasicPortAllocator(&network_manager_)); | 1447 allocator_.reset(new BasicPortAllocator(&network_manager_)); |
1448 RelayServerConfig turn_server(RELAY_TURN); | 1448 RelayServerConfig turn_server(RELAY_TURN); |
1449 RelayCredentials credentials(kTurnUsername, kTurnPassword); | 1449 RelayCredentials credentials(kTurnUsername, kTurnPassword); |
1450 turn_server.credentials = credentials; | 1450 turn_server.credentials = credentials; |
1451 turn_server.ports.push_back( | 1451 turn_server.ports.push_back( |
1452 ProtocolAddress(rtc::SocketAddress("localhost", 3478), PROTO_UDP, false)); | 1452 ProtocolAddress(rtc::SocketAddress("localhost", 3478), PROTO_UDP)); |
1453 allocator_->AddTurnServer(turn_server); | 1453 allocator_->AddTurnServer(turn_server); |
1454 | 1454 |
1455 allocator_->set_step_delay(kMinimumStepDelay); | 1455 allocator_->set_step_delay(kMinimumStepDelay); |
1456 allocator_->set_flags(allocator().flags() | | 1456 allocator_->set_flags(allocator().flags() | |
1457 PORTALLOCATOR_ENABLE_SHARED_SOCKET | | 1457 PORTALLOCATOR_ENABLE_SHARED_SOCKET | |
1458 PORTALLOCATOR_DISABLE_TCP); | 1458 PORTALLOCATOR_DISABLE_TCP); |
1459 | 1459 |
1460 EXPECT_TRUE(CreateSession(ICE_CANDIDATE_COMPONENT_RTP)); | 1460 EXPECT_TRUE(CreateSession(ICE_CANDIDATE_COMPONENT_RTP)); |
1461 session_->StartGettingPorts(); | 1461 session_->StartGettingPorts(); |
1462 | 1462 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1796 for (const Candidate& candidate : candidates) { | 1796 for (const Candidate& candidate : candidates) { |
1797 // Expect only relay candidates now that the filter is applied. | 1797 // Expect only relay candidates now that the filter is applied. |
1798 EXPECT_EQ(std::string(RELAY_PORT_TYPE), candidate.type()); | 1798 EXPECT_EQ(std::string(RELAY_PORT_TYPE), candidate.type()); |
1799 // Expect that the raddr is emptied due to the CF_RELAY filter. | 1799 // Expect that the raddr is emptied due to the CF_RELAY filter. |
1800 EXPECT_EQ(candidate.related_address(), | 1800 EXPECT_EQ(candidate.related_address(), |
1801 rtc::EmptySocketAddressWithFamily(candidate.address().family())); | 1801 rtc::EmptySocketAddressWithFamily(candidate.address().family())); |
1802 } | 1802 } |
1803 } | 1803 } |
1804 | 1804 |
1805 } // namespace cricket | 1805 } // namespace cricket |
OLD | NEW |