OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 ProtocolType int_proto, ProtocolType ext_proto) { | 526 ProtocolType int_proto, ProtocolType ext_proto) { |
527 SocketAddress server_addr = | 527 SocketAddress server_addr = |
528 int_proto == PROTO_TCP ? kTurnTcpIntAddr : kTurnUdpIntAddr; | 528 int_proto == PROTO_TCP ? kTurnTcpIntAddr : kTurnUdpIntAddr; |
529 return CreateTurnPort(addr, socket_factory, int_proto, ext_proto, | 529 return CreateTurnPort(addr, socket_factory, int_proto, ext_proto, |
530 server_addr); | 530 server_addr); |
531 } | 531 } |
532 TurnPort* CreateTurnPort(const SocketAddress& addr, | 532 TurnPort* CreateTurnPort(const SocketAddress& addr, |
533 PacketSocketFactory* socket_factory, | 533 PacketSocketFactory* socket_factory, |
534 ProtocolType int_proto, ProtocolType ext_proto, | 534 ProtocolType int_proto, ProtocolType ext_proto, |
535 const rtc::SocketAddress& server_addr) { | 535 const rtc::SocketAddress& server_addr) { |
536 return TurnPort::Create(&main_, socket_factory, MakeNetwork(addr), 0, 0, | 536 constexpr uint16_t kMinPort = 0; |
| 537 constexpr uint16_t kMaxPort = 0; |
| 538 webrtc::RtcEventLog* event_log = nullptr; |
| 539 return TurnPort::Create(&main_, socket_factory, MakeNetwork(addr), |
| 540 kMinPort, kMaxPort, |
537 username_, password_, | 541 username_, password_, |
538 ProtocolAddress(server_addr, int_proto), | 542 ProtocolAddress(server_addr, int_proto), |
539 kRelayCredentials, 0, std::string()); | 543 kRelayCredentials, 0, std::string(), event_log); |
540 } | 544 } |
541 RelayPort* CreateGturnPort(const SocketAddress& addr, | 545 RelayPort* CreateGturnPort(const SocketAddress& addr, |
542 ProtocolType int_proto, ProtocolType ext_proto) { | 546 ProtocolType int_proto, ProtocolType ext_proto) { |
543 RelayPort* port = CreateGturnPort(addr); | 547 RelayPort* port = CreateGturnPort(addr); |
544 SocketAddress addrs[] = | 548 SocketAddress addrs[] = |
545 { kRelayUdpIntAddr, kRelayTcpIntAddr, kRelaySslTcpIntAddr }; | 549 { kRelayUdpIntAddr, kRelayTcpIntAddr, kRelaySslTcpIntAddr }; |
546 port->AddServerAddress(ProtocolAddress(addrs[int_proto], int_proto)); | 550 port->AddServerAddress(ProtocolAddress(addrs[int_proto], int_proto)); |
547 return port; | 551 return port; |
548 } | 552 } |
549 RelayPort* CreateGturnPort(const SocketAddress& addr) { | 553 RelayPort* CreateGturnPort(const SocketAddress& addr) { |
(...skipping 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2889 port->CreateConnection(candidate, Port::ORIGIN_MESSAGE); | 2893 port->CreateConnection(candidate, Port::ORIGIN_MESSAGE); |
2890 EXPECT_NE(conn1, conn2); | 2894 EXPECT_NE(conn1, conn2); |
2891 conn_in_use = port->GetConnection(address); | 2895 conn_in_use = port->GetConnection(address); |
2892 EXPECT_EQ(conn2, conn_in_use); | 2896 EXPECT_EQ(conn2, conn_in_use); |
2893 EXPECT_EQ(2u, conn_in_use->remote_candidate().generation()); | 2897 EXPECT_EQ(2u, conn_in_use->remote_candidate().generation()); |
2894 | 2898 |
2895 // Make sure the new connection was not deleted. | 2899 // Make sure the new connection was not deleted. |
2896 rtc::Thread::Current()->ProcessMessages(300); | 2900 rtc::Thread::Current()->ProcessMessages(300); |
2897 EXPECT_TRUE(port->GetConnection(address) != nullptr); | 2901 EXPECT_TRUE(port->GetConnection(address) != nullptr); |
2898 } | 2902 } |
OLD | NEW |