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