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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 static std::string ComputeFoundation(const std::string& type, | 123 static std::string ComputeFoundation(const std::string& type, |
124 const std::string& protocol, | 124 const std::string& protocol, |
125 const std::string& relay_protocol, | 125 const std::string& relay_protocol, |
126 const rtc::SocketAddress& base_address) { | 126 const rtc::SocketAddress& base_address) { |
127 std::ostringstream ost; | 127 std::ostringstream ost; |
128 ost << type << base_address.ipaddr().ToString() << protocol << relay_protocol; | 128 ost << type << base_address.ipaddr().ToString() << protocol << relay_protocol; |
129 return rtc::ToString<uint32_t>(rtc::ComputeCrc32(ost.str())); | 129 return rtc::ToString<uint32_t>(rtc::ComputeCrc32(ost.str())); |
130 } | 130 } |
131 | 131 |
132 Port::Port(rtc::Thread* thread, | 132 Port::Port(rtc::Thread* thread, |
| 133 const std::string& type, |
133 rtc::PacketSocketFactory* factory, | 134 rtc::PacketSocketFactory* factory, |
134 rtc::Network* network, | 135 rtc::Network* network, |
135 const rtc::IPAddress& ip, | 136 const rtc::IPAddress& ip, |
136 const std::string& username_fragment, | 137 const std::string& username_fragment, |
137 const std::string& password) | 138 const std::string& password) |
138 : thread_(thread), | 139 : thread_(thread), |
139 factory_(factory), | 140 factory_(factory), |
| 141 type_(type), |
140 send_retransmit_count_attribute_(false), | 142 send_retransmit_count_attribute_(false), |
141 network_(network), | 143 network_(network), |
142 ip_(ip), | 144 ip_(ip), |
143 min_port_(0), | 145 min_port_(0), |
144 max_port_(0), | 146 max_port_(0), |
145 component_(ICE_CANDIDATE_COMPONENT_DEFAULT), | 147 component_(ICE_CANDIDATE_COMPONENT_DEFAULT), |
146 generation_(0), | 148 generation_(0), |
147 ice_username_fragment_(username_fragment), | 149 ice_username_fragment_(username_fragment), |
148 password_(password), | 150 password_(password), |
149 timeout_delay_(kPortTimeoutDelay), | 151 timeout_delay_(kPortTimeoutDelay), |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 ASSERT(sent < 0); | 1538 ASSERT(sent < 0); |
1537 error_ = port_->GetError(); | 1539 error_ = port_->GetError(); |
1538 stats_.sent_discarded_packets++; | 1540 stats_.sent_discarded_packets++; |
1539 } else { | 1541 } else { |
1540 send_rate_tracker_.AddSamples(sent); | 1542 send_rate_tracker_.AddSamples(sent); |
1541 } | 1543 } |
1542 return sent; | 1544 return sent; |
1543 } | 1545 } |
1544 | 1546 |
1545 } // namespace cricket | 1547 } // namespace cricket |
OLD | NEW |