| 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 28 matching lines...) Expand all Loading... |
| 39 #include "net/quic/core/quic_blocked_writer_interface.h" | 39 #include "net/quic/core/quic_blocked_writer_interface.h" |
| 40 #include "net/quic/core/quic_connection_stats.h" | 40 #include "net/quic/core/quic_connection_stats.h" |
| 41 #include "net/quic/core/quic_framer.h" | 41 #include "net/quic/core/quic_framer.h" |
| 42 #include "net/quic/core/quic_multipath_sent_packet_manager.h" | 42 #include "net/quic/core/quic_multipath_sent_packet_manager.h" |
| 43 #include "net/quic/core/quic_one_block_arena.h" | 43 #include "net/quic/core/quic_one_block_arena.h" |
| 44 #include "net/quic/core/quic_packet_creator.h" | 44 #include "net/quic/core/quic_packet_creator.h" |
| 45 #include "net/quic/core/quic_packet_generator.h" | 45 #include "net/quic/core/quic_packet_generator.h" |
| 46 #include "net/quic/core/quic_packet_writer.h" | 46 #include "net/quic/core/quic_packet_writer.h" |
| 47 #include "net/quic/core/quic_protocol.h" | 47 #include "net/quic/core/quic_protocol.h" |
| 48 #include "net/quic/core/quic_received_packet_manager.h" | 48 #include "net/quic/core/quic_received_packet_manager.h" |
| 49 #include "net/quic/core/quic_sent_entropy_manager.h" | |
| 50 #include "net/quic/core/quic_sent_packet_manager_interface.h" | 49 #include "net/quic/core/quic_sent_packet_manager_interface.h" |
| 51 #include "net/quic/core/quic_time.h" | 50 #include "net/quic/core/quic_time.h" |
| 52 #include "net/quic/core/quic_types.h" | 51 #include "net/quic/core/quic_types.h" |
| 53 | 52 |
| 54 namespace net { | 53 namespace net { |
| 55 | 54 |
| 56 class QuicClock; | 55 class QuicClock; |
| 57 class QuicConfig; | 56 class QuicConfig; |
| 58 class QuicConnection; | 57 class QuicConnection; |
| 59 class QuicEncrypter; | 58 class QuicEncrypter; |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 | 776 |
| 778 // Sends a version negotiation packet to the peer. | 777 // Sends a version negotiation packet to the peer. |
| 779 void SendVersionNegotiationPacket(); | 778 void SendVersionNegotiationPacket(); |
| 780 | 779 |
| 781 // Clears any accumulated frames from the last received packet. | 780 // Clears any accumulated frames from the last received packet. |
| 782 void ClearLastFrames(); | 781 void ClearLastFrames(); |
| 783 | 782 |
| 784 // Deletes and clears any queued packets. | 783 // Deletes and clears any queued packets. |
| 785 void ClearQueuedPackets(); | 784 void ClearQueuedPackets(); |
| 786 | 785 |
| 787 // Closes the connection if the sent or received packet manager are tracking | |
| 788 // too many outstanding packets. | |
| 789 void MaybeCloseIfTooManyOutstandingPackets(); | |
| 790 | |
| 791 // Writes as many queued packets as possible. The connection must not be | 786 // Writes as many queued packets as possible. The connection must not be |
| 792 // blocked when this is called. | 787 // blocked when this is called. |
| 793 void WriteQueuedPackets(); | 788 void WriteQueuedPackets(); |
| 794 | 789 |
| 795 // Writes as many pending retransmissions as possible. | 790 // Writes as many pending retransmissions as possible. |
| 796 void WritePendingRetransmissions(); | 791 void WritePendingRetransmissions(); |
| 797 | 792 |
| 798 // Returns true if the packet should be discarded and not sent. | 793 // Returns true if the packet should be discarded and not sent. |
| 799 bool ShouldDiscardPacket(const SerializedPacket& packet); | 794 bool ShouldDiscardPacket(const SerializedPacket& packet); |
| 800 | 795 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 // after idle timeout due to lack of network activity. | 941 // after idle timeout due to lack of network activity. |
| 947 // This is particularly important on mobile, where waking up the radio is | 942 // This is particularly important on mobile, where waking up the radio is |
| 948 // undesirable. | 943 // undesirable. |
| 949 ConnectionCloseBehavior idle_timeout_connection_close_behavior_; | 944 ConnectionCloseBehavior idle_timeout_connection_close_behavior_; |
| 950 | 945 |
| 951 // When true, close the QUIC connection after 5 RTOs. Due to the min rto of | 946 // When true, close the QUIC connection after 5 RTOs. Due to the min rto of |
| 952 // 200ms, this is over 5 seconds. | 947 // 200ms, this is over 5 seconds. |
| 953 bool close_connection_after_five_rtos_; | 948 bool close_connection_after_five_rtos_; |
| 954 | 949 |
| 955 QuicReceivedPacketManager received_packet_manager_; | 950 QuicReceivedPacketManager received_packet_manager_; |
| 956 QuicSentEntropyManager sent_entropy_manager_; | |
| 957 | 951 |
| 958 // Indicates whether an ack should be sent the next time we try to write. | 952 // Indicates whether an ack should be sent the next time we try to write. |
| 959 bool ack_queued_; | 953 bool ack_queued_; |
| 960 // How many retransmittable packets have arrived without sending an ack. | 954 // How many retransmittable packets have arrived without sending an ack. |
| 961 QuicPacketCount num_retransmittable_packets_received_since_last_ack_sent_; | 955 QuicPacketCount num_retransmittable_packets_received_since_last_ack_sent_; |
| 962 // Whether there were missing packets in the last sent ack. | 956 // Whether there were missing packets in the last sent ack. |
| 963 bool last_ack_had_missing_packets_; | 957 bool last_ack_had_missing_packets_; |
| 964 // How many consecutive packets have arrived without sending an ack. | 958 // How many consecutive packets have arrived without sending an ack. |
| 965 QuicPacketCount num_packets_received_since_last_ack_sent_; | 959 QuicPacketCount num_packets_received_since_last_ack_sent_; |
| 966 // Indicates how many consecutive times an ack has arrived which indicates | 960 // Indicates how many consecutive times an ack has arrived which indicates |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 // Indicates whether a write error is encountered currently. This is used to | 1107 // Indicates whether a write error is encountered currently. This is used to |
| 1114 // avoid infinite write errors. | 1108 // avoid infinite write errors. |
| 1115 bool write_error_occured_; | 1109 bool write_error_occured_; |
| 1116 | 1110 |
| 1117 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 1111 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 1118 }; | 1112 }; |
| 1119 | 1113 |
| 1120 } // namespace net | 1114 } // namespace net |
| 1121 | 1115 |
| 1122 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 1116 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |