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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 bool owns_writer, | 253 bool owns_writer, |
254 bool is_server, | 254 bool is_server, |
255 bool is_secure, | 255 bool is_secure, |
256 const QuicVersionVector& supported_versions); | 256 const QuicVersionVector& supported_versions); |
257 ~QuicConnection() override; | 257 ~QuicConnection() override; |
258 | 258 |
259 // Sets connection parameters from the supplied |config|. | 259 // Sets connection parameters from the supplied |config|. |
260 void SetFromConfig(const QuicConfig& config); | 260 void SetFromConfig(const QuicConfig& config); |
261 | 261 |
262 // Called by the Session when the client has provided CachedNetworkParameters. | 262 // Called by the Session when the client has provided CachedNetworkParameters. |
263 // Virtual for tests. | 263 // Returns true if this changes the initial connection state. |
264 virtual void ResumeConnectionState( | 264 virtual bool ResumeConnectionState( |
265 const CachedNetworkParameters& cached_network_params); | 265 const CachedNetworkParameters& cached_network_params); |
266 | 266 |
267 // Sets the number of active streams on the connection for congestion control. | 267 // Sets the number of active streams on the connection for congestion control. |
268 void SetNumOpenStreams(size_t num_streams); | 268 void SetNumOpenStreams(size_t num_streams); |
269 | 269 |
270 // Send the data in |data| to the peer in as few packets as possible. | 270 // Send the data in |data| to the peer in as few packets as possible. |
271 // Returns a pair with the number of bytes consumed from data, and a boolean | 271 // Returns a pair with the number of bytes consumed from data, and a boolean |
272 // indicating if the fin bit was consumed. This does not indicate the data | 272 // indicating if the fin bit was consumed. This does not indicate the data |
273 // has been sent on the wire: it may have been turned into a packet and queued | 273 // has been sent on the wire: it may have been turned into a packet and queued |
274 // if the socket was unexpectedly blocked. |fec_protection| indicates if | 274 // if the socket was unexpectedly blocked. |fec_protection| indicates if |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 scoped_ptr<QuicEncryptedPacket> connection_close_packet_; | 746 scoped_ptr<QuicEncryptedPacket> connection_close_packet_; |
747 | 747 |
748 FecGroupMap group_map_; | 748 FecGroupMap group_map_; |
749 | 749 |
750 QuicReceivedPacketManager received_packet_manager_; | 750 QuicReceivedPacketManager received_packet_manager_; |
751 QuicSentEntropyManager sent_entropy_manager_; | 751 QuicSentEntropyManager sent_entropy_manager_; |
752 | 752 |
753 // Indicates whether an ack should be sent the next time we try to write. | 753 // Indicates whether an ack should be sent the next time we try to write. |
754 bool ack_queued_; | 754 bool ack_queued_; |
755 // Indicates how many consecutive packets have arrived without sending an ack. | 755 // Indicates how many consecutive packets have arrived without sending an ack. |
756 uint32 num_packets_received_since_last_ack_sent_; | 756 QuicPacketCount num_packets_received_since_last_ack_sent_; |
757 // Indicates how many consecutive times an ack has arrived which indicates | 757 // Indicates how many consecutive times an ack has arrived which indicates |
758 // the peer needs to stop waiting for some packets. | 758 // the peer needs to stop waiting for some packets. |
759 int stop_waiting_count_; | 759 int stop_waiting_count_; |
760 | 760 |
761 // An alarm that fires when an ACK should be sent to the peer. | 761 // An alarm that fires when an ACK should be sent to the peer. |
762 scoped_ptr<QuicAlarm> ack_alarm_; | 762 scoped_ptr<QuicAlarm> ack_alarm_; |
763 // An alarm that fires when a packet needs to be retransmitted. | 763 // An alarm that fires when a packet needs to be retransmitted. |
764 scoped_ptr<QuicAlarm> retransmission_alarm_; | 764 scoped_ptr<QuicAlarm> retransmission_alarm_; |
765 // An alarm that is scheduled when the sent scheduler requires a | 765 // An alarm that is scheduled when the sent scheduler requires a |
766 // a delay before sending packets and fires when the packet may be sent. | 766 // a delay before sending packets and fires when the packet may be sent. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 | 838 |
839 // True if this is a secure QUIC connection. | 839 // True if this is a secure QUIC connection. |
840 bool is_secure_; | 840 bool is_secure_; |
841 | 841 |
842 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 842 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
843 }; | 843 }; |
844 | 844 |
845 } // namespace net | 845 } // namespace net |
846 | 846 |
847 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 847 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |