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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 void EnableSavingCryptoPackets(); | 512 void EnableSavingCryptoPackets(); |
513 | 513 |
514 // Returns true if the underlying UDP socket is writable, there is | 514 // Returns true if the underlying UDP socket is writable, there is |
515 // no queued data and the connection is not congestion-control | 515 // no queued data and the connection is not congestion-control |
516 // blocked. | 516 // blocked. |
517 bool CanWriteStreamData(); | 517 bool CanWriteStreamData(); |
518 | 518 |
519 // Returns true if the connection has queued packets or frames. | 519 // Returns true if the connection has queued packets or frames. |
520 bool HasQueuedData() const; | 520 bool HasQueuedData() const; |
521 | 521 |
522 // Sets the overall and idle state connection timeouts. | 522 // Sets the handshake and idle state connection timeouts. |
523 void SetNetworkTimeouts(QuicTime::Delta overall_timeout, | 523 void SetNetworkTimeouts(QuicTime::Delta handshake_timeout, |
524 QuicTime::Delta idle_timeout); | 524 QuicTime::Delta idle_timeout); |
525 | 525 |
526 // If the connection has timed out, this will close the connection. | 526 // If the connection has timed out, this will close the connection. |
527 // Otherwise, it will reschedule the timeout alarm. | 527 // Otherwise, it will reschedule the timeout alarm. |
528 void CheckForTimeout(); | 528 void CheckForTimeout(); |
529 | 529 |
530 // Called when the ping alarm fires. Causes a ping frame to be sent only | 530 // Called when the ping alarm fires. Causes a ping frame to be sent only |
531 // if the retransmission alarm is not running. | 531 // if the retransmission alarm is not running. |
532 void OnPingTimeout(); | 532 void OnPingTimeout(); |
533 | 533 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 | 940 |
941 // Neither visitor is owned by this class. | 941 // Neither visitor is owned by this class. |
942 QuicConnectionVisitorInterface* visitor_; | 942 QuicConnectionVisitorInterface* visitor_; |
943 QuicConnectionDebugVisitor* debug_visitor_; | 943 QuicConnectionDebugVisitor* debug_visitor_; |
944 | 944 |
945 QuicPacketGenerator packet_generator_; | 945 QuicPacketGenerator packet_generator_; |
946 | 946 |
947 // An alarm that fires when an FEC packet should be sent. | 947 // An alarm that fires when an FEC packet should be sent. |
948 QuicArenaScopedPtr<QuicAlarm> fec_alarm_; | 948 QuicArenaScopedPtr<QuicAlarm> fec_alarm_; |
949 | 949 |
950 // Network idle time before we kill of this connection. | 950 // Network idle time before this connection is closed. |
951 QuicTime::Delta idle_network_timeout_; | 951 QuicTime::Delta idle_network_timeout_; |
952 // Overall connection timeout. | 952 // The connection will wait this long for the handshake to complete. |
953 QuicTime::Delta overall_connection_timeout_; | 953 QuicTime::Delta handshake_timeout_; |
954 | 954 |
955 // Statistics for this session. | 955 // Statistics for this session. |
956 QuicConnectionStats stats_; | 956 QuicConnectionStats stats_; |
957 | 957 |
958 // The time that we got a packet for this connection. | 958 // The time that we got a packet for this connection. |
959 // This is used for timeouts, and does not indicate the packet was processed. | 959 // This is used for timeouts, and does not indicate the packet was processed. |
960 QuicTime time_of_last_received_packet_; | 960 QuicTime time_of_last_received_packet_; |
961 | 961 |
962 // The last time this connection began sending a new (non-retransmitted) | 962 // The last time this connection began sending a new (non-retransmitted) |
963 // packet. | 963 // packet. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 | 1038 |
1039 // If true, multipath is enabled for this connection. | 1039 // If true, multipath is enabled for this connection. |
1040 bool multipath_enabled_; | 1040 bool multipath_enabled_; |
1041 | 1041 |
1042 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 1042 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
1043 }; | 1043 }; |
1044 | 1044 |
1045 } // namespace net | 1045 } // namespace net |
1046 | 1046 |
1047 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 1047 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |