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 // The entity that handles framing writes for a Quic client or server. | 5 // The entity that handles framing writes for a Quic client or server. |
6 // Each QuicSession will have a connection associated with it. | 6 // Each QuicSession will have a connection associated with it. |
7 // | 7 // |
8 // On the server side, the Dispatcher handles the raw reads, and hands off | 8 // On the server side, the Dispatcher handles the raw reads, and hands off |
9 // packets via ProcessUdpPacket for framing and processing. | 9 // packets via ProcessUdpPacket for framing and processing. |
10 // | 10 // |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 } | 418 } |
419 | 419 |
420 // Returns true if the underlying UDP socket is writable, there is | 420 // Returns true if the underlying UDP socket is writable, there is |
421 // no queued data and the connection is not congestion-control | 421 // no queued data and the connection is not congestion-control |
422 // blocked. | 422 // blocked. |
423 bool CanWriteStreamData(); | 423 bool CanWriteStreamData(); |
424 | 424 |
425 // Returns true if the connection has queued packets or frames. | 425 // Returns true if the connection has queued packets or frames. |
426 bool HasQueuedData() const; | 426 bool HasQueuedData() const; |
427 | 427 |
| 428 // TODO(ianswett): Remove when quic_unified_timeouts is removed. |
428 // Sets (or resets) the idle state connection timeout. Also, checks and times | 429 // Sets (or resets) the idle state connection timeout. Also, checks and times |
429 // out the connection if network timer has expired for |timeout|. | 430 // out the connection if network timer has expired for |timeout|. |
430 void SetIdleNetworkTimeout(QuicTime::Delta timeout); | 431 void SetIdleNetworkTimeout(QuicTime::Delta timeout); |
431 // Sets (or resets) the total time delta the connection can be alive for. | 432 // Sets (or resets) the total time delta the connection can be alive for. |
432 // Also, checks and times out the connection if timer has expired for | 433 // Also, checks and times out the connection if timer has expired for |
433 // |timeout|. Used to limit the time a connection can be alive before crypto | 434 // |timeout|. Used to limit the time a connection can be alive before crypto |
434 // handshake finishes. | 435 // handshake finishes. |
435 void SetOverallConnectionTimeout(QuicTime::Delta timeout); | 436 void SetOverallConnectionTimeout(QuicTime::Delta timeout); |
436 | 437 |
| 438 // Sets the overall and idle state connection timeouts. |
| 439 // Times out the connection if the timeout has been reached and |
| 440 // the quic_timeouts_only_from_alarms flag is false. |
| 441 void SetNetworkTimeouts(QuicTime::Delta overall_timeout, |
| 442 QuicTime::Delta idle_timeout); |
| 443 |
437 // If the connection has timed out, this will close the connection. | 444 // If the connection has timed out, this will close the connection. |
438 // Otherwise, it will reschedule the timeout alarm. | 445 // Otherwise, it will reschedule the timeout alarm. |
439 void CheckForTimeout(); | 446 void CheckForTimeout(); |
440 | 447 |
441 // Sends a ping, and resets the ping alarm. | 448 // Sends a ping, and resets the ping alarm. |
442 void SendPing(); | 449 void SendPing(); |
443 | 450 |
444 // Sets up a packet with an QuicAckFrame and sends it out. | 451 // Sets up a packet with an QuicAckFrame and sends it out. |
445 void SendAck(); | 452 void SendAck(); |
446 | 453 |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 // If non-empty this contains the set of versions received in a | 811 // If non-empty this contains the set of versions received in a |
805 // version negotiation packet. | 812 // version negotiation packet. |
806 QuicVersionVector server_supported_versions_; | 813 QuicVersionVector server_supported_versions_; |
807 | 814 |
808 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 815 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
809 }; | 816 }; |
810 | 817 |
811 } // namespace net | 818 } // namespace net |
812 | 819 |
813 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 820 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |