| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 friend class test::QuicConnectionPeer; | 571 friend class test::QuicConnectionPeer; |
| 572 friend class test::PacketSavingConnection; | 572 friend class test::PacketSavingConnection; |
| 573 | 573 |
| 574 typedef std::list<QueuedPacket> QueuedPacketList; | 574 typedef std::list<QueuedPacket> QueuedPacketList; |
| 575 typedef std::map<QuicFecGroupNumber, QuicFecGroup*> FecGroupMap; | 575 typedef std::map<QuicFecGroupNumber, QuicFecGroup*> FecGroupMap; |
| 576 | 576 |
| 577 // Writes the given packet to socket, encrypted with packet's | 577 // Writes the given packet to socket, encrypted with packet's |
| 578 // encryption_level. Returns true on successful write, and false if the writer | 578 // encryption_level. Returns true on successful write, and false if the writer |
| 579 // was blocked and the write needs to be tried again. Notifies the | 579 // was blocked and the write needs to be tried again. Notifies the |
| 580 // SentPacketManager when the write is successful and sets | 580 // SentPacketManager when the write is successful and sets |
| 581 // retransmittable frames to NULL. | 581 // retransmittable frames to nullptr. |
| 582 // Saves the connection close packet for later transmission, even if the | 582 // Saves the connection close packet for later transmission, even if the |
| 583 // writer is write blocked. | 583 // writer is write blocked. |
| 584 bool WritePacket(QueuedPacket* packet); | 584 bool WritePacket(QueuedPacket* packet); |
| 585 | 585 |
| 586 // Does the main work of WritePacket, but does not delete the packet or | 586 // Does the main work of WritePacket, but does not delete the packet or |
| 587 // retransmittable frames upon success. | 587 // retransmittable frames upon success. |
| 588 bool WritePacketInner(QueuedPacket* packet); | 588 bool WritePacketInner(QueuedPacket* packet); |
| 589 | 589 |
| 590 // Make sure an ack we got from our peer is sane. | 590 // Make sure an ack we got from our peer is sane. |
| 591 bool ValidateAckFrame(const QuicAckFrame& incoming_ack); | 591 bool ValidateAckFrame(const QuicAckFrame& incoming_ack); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 void UpdateStopWaitingCount(); | 639 void UpdateStopWaitingCount(); |
| 640 | 640 |
| 641 // Sends any packets which are a response to the last packet, including both | 641 // Sends any packets which are a response to the last packet, including both |
| 642 // acks and pending writes if an ack opened the congestion window. | 642 // acks and pending writes if an ack opened the congestion window. |
| 643 void MaybeSendInResponseToPacket(); | 643 void MaybeSendInResponseToPacket(); |
| 644 | 644 |
| 645 // Gets the least unacked sequence number, which is the next sequence number | 645 // Gets the least unacked sequence number, which is the next sequence number |
| 646 // to be sent if there are no outstanding packets. | 646 // to be sent if there are no outstanding packets. |
| 647 QuicPacketSequenceNumber GetLeastUnacked() const; | 647 QuicPacketSequenceNumber GetLeastUnacked() const; |
| 648 | 648 |
| 649 // Get the FEC group associate with the last processed packet or NULL, if the | 649 // Get the FEC group associate with the last processed packet or nullptr, if |
| 650 // group has already been deleted. | 650 // the group has already been deleted. |
| 651 QuicFecGroup* GetFecGroup(); | 651 QuicFecGroup* GetFecGroup(); |
| 652 | 652 |
| 653 // Closes any FEC groups protecting packets before |sequence_number|. | 653 // Closes any FEC groups protecting packets before |sequence_number|. |
| 654 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); | 654 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); |
| 655 | 655 |
| 656 // Sets the timeout alarm to the appropriate value, if any. | 656 // Sets the timeout alarm to the appropriate value, if any. |
| 657 void SetTimeoutAlarm(); | 657 void SetTimeoutAlarm(); |
| 658 | 658 |
| 659 // Sets the ping alarm to the appropriate value, if any. | 659 // Sets the ping alarm to the appropriate value, if any. |
| 660 void SetPingAlarm(); | 660 void SetPingAlarm(); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 // 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 |
| 812 // version negotiation packet. | 812 // version negotiation packet. |
| 813 QuicVersionVector server_supported_versions_; | 813 QuicVersionVector server_supported_versions_; |
| 814 | 814 |
| 815 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 815 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 816 }; | 816 }; |
| 817 | 817 |
| 818 } // namespace net | 818 } // namespace net |
| 819 | 819 |
| 820 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 820 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |