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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 debug_visitor_ = debug_visitor; | 450 debug_visitor_ = debug_visitor; |
451 packet_generator_.set_debug_delegate(debug_visitor); | 451 packet_generator_.set_debug_delegate(debug_visitor); |
452 sent_packet_manager_.set_debug_delegate(debug_visitor); | 452 sent_packet_manager_.set_debug_delegate(debug_visitor); |
453 } | 453 } |
454 const IPEndPoint& self_address() const { return self_address_; } | 454 const IPEndPoint& self_address() const { return self_address_; } |
455 const IPEndPoint& peer_address() const { return peer_address_; } | 455 const IPEndPoint& peer_address() const { return peer_address_; } |
456 QuicConnectionId connection_id() const { return connection_id_; } | 456 QuicConnectionId connection_id() const { return connection_id_; } |
457 const QuicClock* clock() const { return clock_; } | 457 const QuicClock* clock() const { return clock_; } |
458 QuicRandom* random_generator() const { return random_generator_; } | 458 QuicRandom* random_generator() const { return random_generator_; } |
459 QuicByteCount max_packet_length() const; | 459 QuicByteCount max_packet_length() const; |
460 void set_max_packet_length(QuicByteCount length); | 460 void SetMaxPacketLength(QuicByteCount length); |
461 | 461 |
462 size_t mtu_probe_count() const { return mtu_probe_count_; } | 462 size_t mtu_probe_count() const { return mtu_probe_count_; } |
463 | 463 |
464 bool connected() const { return connected_; } | 464 bool connected() const { return connected_; } |
465 | 465 |
466 bool goaway_sent() const { return goaway_sent_; } | 466 bool goaway_sent() const { return goaway_sent_; } |
467 | 467 |
468 bool goaway_received() const { return goaway_received_; } | 468 bool goaway_received() const { return goaway_received_; } |
469 | 469 |
470 // Must only be called on client connections. | 470 // Must only be called on client connections. |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 void MaybeSetMtuAlarm(); | 763 void MaybeSetMtuAlarm(); |
764 | 764 |
765 // On arrival of a new packet, checks to see if the socket addresses have | 765 // On arrival of a new packet, checks to see if the socket addresses have |
766 // changed since the last packet we saw on this connection. | 766 // changed since the last packet we saw on this connection. |
767 void CheckForAddressMigration(const IPEndPoint& self_address, | 767 void CheckForAddressMigration(const IPEndPoint& self_address, |
768 const IPEndPoint& peer_address); | 768 const IPEndPoint& peer_address); |
769 | 769 |
770 HasRetransmittableData IsRetransmittable(const QueuedPacket& packet); | 770 HasRetransmittableData IsRetransmittable(const QueuedPacket& packet); |
771 bool IsConnectionClose(const QueuedPacket& packet); | 771 bool IsConnectionClose(const QueuedPacket& packet); |
772 | 772 |
| 773 // Set the size of the packet we are targeting while doing path MTU discovery. |
| 774 void SetMtuDiscoveryTarget(QuicByteCount target); |
| 775 |
| 776 // Validates the potential maximum packet size, and reduces it if it exceeds |
| 777 // the largest supported by the protocol or the packet writer. |
| 778 QuicByteCount LimitMaxPacketSize(QuicByteCount suggested_max_packet_size); |
| 779 |
773 QuicFramer framer_; | 780 QuicFramer framer_; |
774 QuicConnectionHelperInterface* helper_; // Not owned. | 781 QuicConnectionHelperInterface* helper_; // Not owned. |
775 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. | 782 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. |
776 bool owns_writer_; | 783 bool owns_writer_; |
777 // Encryption level for new packets. Should only be changed via | 784 // Encryption level for new packets. Should only be changed via |
778 // SetDefaultEncryptionLevel(). | 785 // SetDefaultEncryptionLevel(). |
779 EncryptionLevel encryption_level_; | 786 EncryptionLevel encryption_level_; |
780 bool has_forward_secure_encrypter_; | 787 bool has_forward_secure_encrypter_; |
781 // The packet number of the first packet which will be encrypted with the | 788 // The packet number of the first packet which will be encrypted with the |
782 // foward-secure encrypter, even if the peer has not started sending | 789 // foward-secure encrypter, even if the peer has not started sending |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 | 982 |
976 // Whether a GoAway has been received. | 983 // Whether a GoAway has been received. |
977 bool goaway_received_; | 984 bool goaway_received_; |
978 | 985 |
979 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 986 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
980 }; | 987 }; |
981 | 988 |
982 } // namespace net | 989 } // namespace net |
983 | 990 |
984 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 991 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |