Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: webrtc/p2p/base/port.h

Issue 1422623015: Do not delete a connection until it has not received anything for 30 seconds. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync to head Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/p2p/base/port.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // RFC 6544, TCP candidate encoding rules. 47 // RFC 6544, TCP candidate encoding rules.
48 extern const int DISCARD_PORT; 48 extern const int DISCARD_PORT;
49 extern const char TCPTYPE_ACTIVE_STR[]; 49 extern const char TCPTYPE_ACTIVE_STR[];
50 extern const char TCPTYPE_PASSIVE_STR[]; 50 extern const char TCPTYPE_PASSIVE_STR[];
51 extern const char TCPTYPE_SIMOPEN_STR[]; 51 extern const char TCPTYPE_SIMOPEN_STR[];
52 52
53 // The minimum time we will wait before destroying a connection after creating 53 // The minimum time we will wait before destroying a connection after creating
54 // it. 54 // it.
55 const uint32_t MIN_CONNECTION_LIFETIME = 10 * 1000; // 10 seconds. 55 const uint32_t MIN_CONNECTION_LIFETIME = 10 * 1000; // 10 seconds.
56 56
57 // A connection will be declared dead if it has not received anything for this
58 // long.
59 const uint32_t DEAD_CONNECTION_RECEIVE_TIMEOUT = 30 * 1000; // 30 seconds.
60
57 // The timeout duration when a connection does not receive anything. 61 // The timeout duration when a connection does not receive anything.
58 const uint32_t WEAK_CONNECTION_RECEIVE_TIMEOUT = 2500; // 2.5 seconds 62 const uint32_t WEAK_CONNECTION_RECEIVE_TIMEOUT = 2500; // 2.5 seconds
59 63
60 // The length of time we wait before timing out writability on a connection. 64 // The length of time we wait before timing out writability on a connection.
61 const uint32_t CONNECTION_WRITE_TIMEOUT = 15 * 1000; // 15 seconds 65 const uint32_t CONNECTION_WRITE_TIMEOUT = 15 * 1000; // 15 seconds
62 66
63 // The length of time we wait before we become unwritable. 67 // The length of time we wait before we become unwritable.
64 const uint32_t CONNECTION_WRITE_CONNECT_TIMEOUT = 5 * 1000; // 5 seconds 68 const uint32_t CONNECTION_WRITE_CONNECT_TIMEOUT = 5 * 1000; // 5 seconds
65 69
66 // The number of pings that must fail to respond before we become unwritable. 70 // The number of pings that must fail to respond before we become unwritable.
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 void MaybeSetRemoteIceCredentials(const std::string& ice_ufrag, 556 void MaybeSetRemoteIceCredentials(const std::string& ice_ufrag,
553 const std::string& ice_pwd); 557 const std::string& ice_pwd);
554 558
555 // If |remote_candidate_| is peer reflexive and is equivalent to 559 // If |remote_candidate_| is peer reflexive and is equivalent to
556 // |new_candidate| except the type, update |remote_candidate_| to 560 // |new_candidate| except the type, update |remote_candidate_| to
557 // |new_candidate|. 561 // |new_candidate|.
558 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate); 562 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate);
559 563
560 // Returns the last received time of any data, stun request, or stun 564 // Returns the last received time of any data, stun request, or stun
561 // response in milliseconds 565 // response in milliseconds
562 uint32_t last_received(); 566 uint32_t last_received() const;
563 567
564 protected: 568 protected:
565 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE }; 569 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE };
566 570
567 // Constructs a new connection to the given remote port. 571 // Constructs a new connection to the given remote port.
568 Connection(Port* port, size_t index, const Candidate& candidate); 572 Connection(Port* port, size_t index, const Candidate& candidate);
569 573
570 // Called back when StunRequestManager has a stun packet to send 574 // Called back when StunRequestManager has a stun packet to send
571 void OnSendStunPacket(const void* data, size_t size, StunRequest* req); 575 void OnSendStunPacket(const void* data, size_t size, StunRequest* req);
572 576
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 const rtc::PacketOptions& options); 643 const rtc::PacketOptions& options);
640 virtual int GetError() { return error_; } 644 virtual int GetError() { return error_; }
641 645
642 private: 646 private:
643 int error_; 647 int error_;
644 }; 648 };
645 649
646 } // namespace cricket 650 } // namespace cricket
647 651
648 #endif // WEBRTC_P2P_BASE_PORT_H_ 652 #endif // WEBRTC_P2P_BASE_PORT_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/p2p/base/port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698