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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |