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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 min_port_(0), | 143 min_port_(0), |
144 max_port_(0), | 144 max_port_(0), |
145 component_(ICE_CANDIDATE_COMPONENT_DEFAULT), | 145 component_(ICE_CANDIDATE_COMPONENT_DEFAULT), |
146 generation_(0), | 146 generation_(0), |
147 ice_username_fragment_(username_fragment), | 147 ice_username_fragment_(username_fragment), |
148 password_(password), | 148 password_(password), |
149 timeout_delay_(kPortTimeoutDelay), | 149 timeout_delay_(kPortTimeoutDelay), |
150 enable_port_packets_(false), | 150 enable_port_packets_(false), |
151 ice_role_(ICEROLE_UNKNOWN), | 151 ice_role_(ICEROLE_UNKNOWN), |
152 tiebreaker_(0), | 152 tiebreaker_(0), |
153 shared_socket_(true), | 153 shared_socket_(true) { |
154 candidate_filter_(CF_ALL) { | |
155 Construct(); | 154 Construct(); |
156 } | 155 } |
157 | 156 |
158 Port::Port(rtc::Thread* thread, | 157 Port::Port(rtc::Thread* thread, |
159 const std::string& type, | 158 const std::string& type, |
160 rtc::PacketSocketFactory* factory, | 159 rtc::PacketSocketFactory* factory, |
161 rtc::Network* network, | 160 rtc::Network* network, |
162 const rtc::IPAddress& ip, | 161 const rtc::IPAddress& ip, |
163 uint16_t min_port, | 162 uint16_t min_port, |
164 uint16_t max_port, | 163 uint16_t max_port, |
165 const std::string& username_fragment, | 164 const std::string& username_fragment, |
166 const std::string& password) | 165 const std::string& password) |
167 : thread_(thread), | 166 : thread_(thread), |
168 factory_(factory), | 167 factory_(factory), |
169 type_(type), | 168 type_(type), |
170 send_retransmit_count_attribute_(false), | 169 send_retransmit_count_attribute_(false), |
171 network_(network), | 170 network_(network), |
172 ip_(ip), | 171 ip_(ip), |
173 min_port_(min_port), | 172 min_port_(min_port), |
174 max_port_(max_port), | 173 max_port_(max_port), |
175 component_(ICE_CANDIDATE_COMPONENT_DEFAULT), | 174 component_(ICE_CANDIDATE_COMPONENT_DEFAULT), |
176 generation_(0), | 175 generation_(0), |
177 ice_username_fragment_(username_fragment), | 176 ice_username_fragment_(username_fragment), |
178 password_(password), | 177 password_(password), |
179 timeout_delay_(kPortTimeoutDelay), | 178 timeout_delay_(kPortTimeoutDelay), |
180 enable_port_packets_(false), | 179 enable_port_packets_(false), |
181 ice_role_(ICEROLE_UNKNOWN), | 180 ice_role_(ICEROLE_UNKNOWN), |
182 tiebreaker_(0), | 181 tiebreaker_(0), |
183 shared_socket_(false), | 182 shared_socket_(false) { |
184 candidate_filter_(CF_ALL) { | |
185 ASSERT(factory_ != NULL); | 183 ASSERT(factory_ != NULL); |
186 Construct(); | 184 Construct(); |
187 } | 185 } |
188 | 186 |
189 void Port::Construct() { | 187 void Port::Construct() { |
190 // TODO(pthatcher): Remove this old behavior once we're sure no one | 188 // TODO(pthatcher): Remove this old behavior once we're sure no one |
191 // relies on it. If the username_fragment and password are empty, | 189 // relies on it. If the username_fragment and password are empty, |
192 // we should just create one. | 190 // we should just create one. |
193 if (ice_username_fragment_.empty()) { | 191 if (ice_username_fragment_.empty()) { |
194 ASSERT(password_.empty()); | 192 ASSERT(password_.empty()); |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 ASSERT(sent < 0); | 1503 ASSERT(sent < 0); |
1506 error_ = port_->GetError(); | 1504 error_ = port_->GetError(); |
1507 sent_packets_discarded_++; | 1505 sent_packets_discarded_++; |
1508 } else { | 1506 } else { |
1509 send_rate_tracker_.AddSamples(sent); | 1507 send_rate_tracker_.AddSamples(sent); |
1510 } | 1508 } |
1511 return sent; | 1509 return sent; |
1512 } | 1510 } |
1513 | 1511 |
1514 } // namespace cricket | 1512 } // namespace cricket |
OLD | NEW |