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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 ip_(network->GetBestIP()), | 685 ip_(network->GetBestIP()), |
686 config_(config), | 686 config_(config), |
687 state_(kInit), | 687 state_(kInit), |
688 flags_(flags), | 688 flags_(flags), |
689 udp_socket_(), | 689 udp_socket_(), |
690 udp_port_(NULL), | 690 udp_port_(NULL), |
691 phase_(0) { | 691 phase_(0) { |
692 } | 692 } |
693 | 693 |
694 bool AllocationSequence::Init() { | 694 bool AllocationSequence::Init() { |
| 695 if (IsFlagSet(PORTALLOCATOR_ENABLE_SHARED_SOCKET) && |
| 696 !IsFlagSet(PORTALLOCATOR_ENABLE_SHARED_UFRAG)) { |
| 697 LOG(LS_ERROR) << "Shared socket option can't be set without " |
| 698 << "shared ufrag."; |
| 699 ASSERT(false); |
| 700 return false; |
| 701 } |
| 702 |
695 if (IsFlagSet(PORTALLOCATOR_ENABLE_SHARED_SOCKET)) { | 703 if (IsFlagSet(PORTALLOCATOR_ENABLE_SHARED_SOCKET)) { |
696 udp_socket_.reset(session_->socket_factory()->CreateUdpSocket( | 704 udp_socket_.reset(session_->socket_factory()->CreateUdpSocket( |
697 rtc::SocketAddress(ip_, 0), session_->allocator()->min_port(), | 705 rtc::SocketAddress(ip_, 0), session_->allocator()->min_port(), |
698 session_->allocator()->max_port())); | 706 session_->allocator()->max_port())); |
699 if (udp_socket_) { | 707 if (udp_socket_) { |
700 udp_socket_->SignalReadPacket.connect( | 708 udp_socket_->SignalReadPacket.connect( |
701 this, &AllocationSequence::OnReadPacket); | 709 this, &AllocationSequence::OnReadPacket); |
702 } | 710 } |
703 // Continuing if |udp_socket_| is NULL, as local TCP and RelayPort using TCP | 711 // Continuing if |udp_socket_| is NULL, as local TCP and RelayPort using TCP |
704 // are next available options to setup a communication channel. | 712 // are next available options to setup a communication channel. |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 ServerAddresses servers; | 1141 ServerAddresses servers; |
1134 for (size_t i = 0; i < relays.size(); ++i) { | 1142 for (size_t i = 0; i < relays.size(); ++i) { |
1135 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { | 1143 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { |
1136 servers.insert(relays[i].ports.front().address); | 1144 servers.insert(relays[i].ports.front().address); |
1137 } | 1145 } |
1138 } | 1146 } |
1139 return servers; | 1147 return servers; |
1140 } | 1148 } |
1141 | 1149 |
1142 } // namespace cricket | 1150 } // namespace cricket |
OLD | NEW |