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 <list> | 10 #include <list> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 // Default ping timeout. | 118 // Default ping timeout. |
119 const int64 kPingTimeoutSecs = 15; // 15 secs. | 119 const int64 kPingTimeoutSecs = 15; // 15 secs. |
120 | 120 |
121 // Minimum number of RTTs between Server Config Updates (SCUP) sent to client. | 121 // Minimum number of RTTs between Server Config Updates (SCUP) sent to client. |
122 const int kMinIntervalBetweenServerConfigUpdatesRTTs = 10; | 122 const int kMinIntervalBetweenServerConfigUpdatesRTTs = 10; |
123 | 123 |
124 // Minimum time between Server Config Updates (SCUP) sent to client. | 124 // Minimum time between Server Config Updates (SCUP) sent to client. |
125 const int kMinIntervalBetweenServerConfigUpdatesMs = 1000; | 125 const int kMinIntervalBetweenServerConfigUpdatesMs = 1000; |
126 | 126 |
127 // Multiplier that allows server to accept slightly more streams than | 127 // The number of open streams that a server will accept is set to be slightly |
128 // negotiated in handshake. | 128 // larger than the negotiated limit. Immediately closing the connection if the |
| 129 // client opens slightly too many streams is not ideal: the client may have sent |
| 130 // a FIN that was lost, and simultaneously opened a new stream. The number of |
| 131 // streams a server accepts is a fixed increment over the negotiated limit, or a |
| 132 // percentage increase, whichever is larger. |
129 const float kMaxStreamsMultiplier = 1.1f; | 133 const float kMaxStreamsMultiplier = 1.1f; |
| 134 const int kMaxStreamsMinimumIncrement = 10; |
130 | 135 |
131 // We define an unsigned 16-bit floating point value, inspired by IEEE floats | 136 // We define an unsigned 16-bit floating point value, inspired by IEEE floats |
132 // (http://en.wikipedia.org/wiki/Half_precision_floating-point_format), | 137 // (http://en.wikipedia.org/wiki/Half_precision_floating-point_format), |
133 // with 5-bit exponent (bias 1), 11-bit mantissa (effective 12 with hidden | 138 // with 5-bit exponent (bias 1), 11-bit mantissa (effective 12 with hidden |
134 // bit) and denormals, but without signs, transfinites or fractions. Wire format | 139 // bit) and denormals, but without signs, transfinites or fractions. Wire format |
135 // 16 bits (little-endian byte order) are split into exponent (high 5) and | 140 // 16 bits (little-endian byte order) are split into exponent (high 5) and |
136 // mantissa (low 11) and decoded as: | 141 // mantissa (low 11) and decoded as: |
137 // uint64 value; | 142 // uint64 value; |
138 // if (exponent == 0) value = mantissa; | 143 // if (exponent == 0) value = mantissa; |
139 // else value = (mantissa | 1 << 11) << (exponent - 1) | 144 // else value = (mantissa | 1 << 11) << (exponent - 1) |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 SequenceNumberList* all_transmissions; | 1084 SequenceNumberList* all_transmissions; |
1080 // In flight packets have not been abandoned or lost. | 1085 // In flight packets have not been abandoned or lost. |
1081 bool in_flight; | 1086 bool in_flight; |
1082 // True if the packet can never be acked, so it can be removed. | 1087 // True if the packet can never be acked, so it can be removed. |
1083 bool is_unackable; | 1088 bool is_unackable; |
1084 }; | 1089 }; |
1085 | 1090 |
1086 } // namespace net | 1091 } // namespace net |
1087 | 1092 |
1088 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1093 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |