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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 void Connection::Destroy() { | 1083 void Connection::Destroy() { |
1084 LOG_J(LS_VERBOSE, this) << "Connection destroyed"; | 1084 LOG_J(LS_VERBOSE, this) << "Connection destroyed"; |
1085 port_->thread()->Post(RTC_FROM_HERE, this, MSG_DELETE); | 1085 port_->thread()->Post(RTC_FROM_HERE, this, MSG_DELETE); |
1086 } | 1086 } |
1087 | 1087 |
1088 void Connection::FailAndDestroy() { | 1088 void Connection::FailAndDestroy() { |
1089 set_state(Connection::STATE_FAILED); | 1089 set_state(Connection::STATE_FAILED); |
1090 Destroy(); | 1090 Destroy(); |
1091 } | 1091 } |
1092 | 1092 |
1093 void Connection::FailAndPrune() { | |
1094 set_state(Connection::STATE_FAILED); | |
1095 Prune(); | |
1096 } | |
1097 | |
1098 void Connection::PrintPingsSinceLastResponse(std::string* s, size_t max) { | 1093 void Connection::PrintPingsSinceLastResponse(std::string* s, size_t max) { |
1099 std::ostringstream oss; | 1094 std::ostringstream oss; |
1100 oss << std::boolalpha; | 1095 oss << std::boolalpha; |
1101 if (pings_since_last_response_.size() > max) { | 1096 if (pings_since_last_response_.size() > max) { |
1102 for (size_t i = 0; i < max; i++) { | 1097 for (size_t i = 0; i < max; i++) { |
1103 const SentPing& ping = pings_since_last_response_[i]; | 1098 const SentPing& ping = pings_since_last_response_[i]; |
1104 oss << rtc::hex_encode(ping.id) << " "; | 1099 oss << rtc::hex_encode(ping.id) << " "; |
1105 } | 1100 } |
1106 oss << "... " << (pings_since_last_response_.size() - max) << " more"; | 1101 oss << "... " << (pings_since_last_response_.size() - max) << " more"; |
1107 } else { | 1102 } else { |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 ASSERT(sent < 0); | 1531 ASSERT(sent < 0); |
1537 error_ = port_->GetError(); | 1532 error_ = port_->GetError(); |
1538 stats_.sent_discarded_packets++; | 1533 stats_.sent_discarded_packets++; |
1539 } else { | 1534 } else { |
1540 send_rate_tracker_.AddSamples(sent); | 1535 send_rate_tracker_.AddSamples(sent); |
1541 } | 1536 } |
1542 return sent; | 1537 return sent; |
1543 } | 1538 } |
1544 | 1539 |
1545 } // namespace cricket | 1540 } // namespace cricket |
OLD | NEW |