OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ | 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ |
6 #define NET_QUIC_QUIC_PROTOCOL_H_ | 6 #define NET_QUIC_QUIC_PROTOCOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 // Reserved ID for the headers stream. | 104 // Reserved ID for the headers stream. |
105 const QuicStreamId kHeadersStreamId = 3; | 105 const QuicStreamId kHeadersStreamId = 3; |
106 | 106 |
107 // This is the default network timeout a for connection till the crypto | 107 // This is the default network timeout a for connection till the crypto |
108 // handshake succeeds and the negotiated timeout from the handshake is received. | 108 // handshake succeeds and the negotiated timeout from the handshake is received. |
109 const int64 kDefaultInitialTimeoutSecs = 120; // 2 mins. | 109 const int64 kDefaultInitialTimeoutSecs = 120; // 2 mins. |
110 const int64 kDefaultTimeoutSecs = 60 * 10; // 10 minutes. | 110 const int64 kDefaultTimeoutSecs = 60 * 10; // 10 minutes. |
111 const int64 kDefaultMaxTimeForCryptoHandshakeSecs = 5; // 5 secs. | 111 const int64 kDefaultMaxTimeForCryptoHandshakeSecs = 5; // 5 secs. |
112 | 112 |
| 113 // Default ping timeout. |
| 114 const int64 kPingTimeoutSecs = 15; // 15 secs. |
| 115 |
113 // We define an unsigned 16-bit floating point value, inspired by IEEE floats | 116 // We define an unsigned 16-bit floating point value, inspired by IEEE floats |
114 // (http://en.wikipedia.org/wiki/Half_precision_floating-point_format), | 117 // (http://en.wikipedia.org/wiki/Half_precision_floating-point_format), |
115 // with 5-bit exponent (bias 1), 11-bit mantissa (effective 12 with hidden | 118 // with 5-bit exponent (bias 1), 11-bit mantissa (effective 12 with hidden |
116 // bit) and denormals, but without signs, transfinites or fractions. Wire format | 119 // bit) and denormals, but without signs, transfinites or fractions. Wire format |
117 // 16 bits (little-endian byte order) are split into exponent (high 5) and | 120 // 16 bits (little-endian byte order) are split into exponent (high 5) and |
118 // mantissa (low 11) and decoded as: | 121 // mantissa (low 11) and decoded as: |
119 // uint64 value; | 122 // uint64 value; |
120 // if (exponent == 0) value = mantissa; | 123 // if (exponent == 0) value = mantissa; |
121 // else value = (mantissa | 1 << 11) << (exponent - 1) | 124 // else value = (mantissa | 1 << 11) << (exponent - 1) |
122 const int kUFloat16ExponentBits = 5; | 125 const int kUFloat16ExponentBits = 5; |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 WriteStatus status; | 1031 WriteStatus status; |
1029 union { | 1032 union { |
1030 int bytes_written; // only valid when status is OK | 1033 int bytes_written; // only valid when status is OK |
1031 int error_code; // only valid when status is ERROR | 1034 int error_code; // only valid when status is ERROR |
1032 }; | 1035 }; |
1033 }; | 1036 }; |
1034 | 1037 |
1035 } // namespace net | 1038 } // namespace net |
1036 | 1039 |
1037 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1040 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |