| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // Constructs a new QuicConnection for |connection_id| and |address|. Invokes | 287 // Constructs a new QuicConnection for |connection_id| and |address|. Invokes |
| 288 // writer_factory->Create() to get a writer; |owns_writer| specifies whether | 288 // writer_factory->Create() to get a writer; |owns_writer| specifies whether |
| 289 // the connection takes ownership of the returned writer. |helper| must | 289 // the connection takes ownership of the returned writer. |helper| must |
| 290 // outlive this connection. | 290 // outlive this connection. |
| 291 QuicConnection(QuicConnectionId connection_id, | 291 QuicConnection(QuicConnectionId connection_id, |
| 292 IPEndPoint address, | 292 IPEndPoint address, |
| 293 QuicConnectionHelperInterface* helper, | 293 QuicConnectionHelperInterface* helper, |
| 294 const PacketWriterFactory& writer_factory, | 294 const PacketWriterFactory& writer_factory, |
| 295 bool owns_writer, | 295 bool owns_writer, |
| 296 Perspective perspective, | 296 Perspective perspective, |
| 297 bool is_secure, | |
| 298 const QuicVersionVector& supported_versions); | 297 const QuicVersionVector& supported_versions); |
| 299 ~QuicConnection() override; | 298 ~QuicConnection() override; |
| 300 | 299 |
| 301 // Sets connection parameters from the supplied |config|. | 300 // Sets connection parameters from the supplied |config|. |
| 302 void SetFromConfig(const QuicConfig& config); | 301 void SetFromConfig(const QuicConfig& config); |
| 303 | 302 |
| 304 // Called by the session when sending connection state to the client. | 303 // Called by the session when sending connection state to the client. |
| 305 virtual void OnSendConnectionState( | 304 virtual void OnSendConnectionState( |
| 306 const CachedNetworkParameters& cached_network_params); | 305 const CachedNetworkParameters& cached_network_params); |
| 307 | 306 |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 const bool already_delayed_; | 603 const bool already_delayed_; |
| 605 }; | 604 }; |
| 606 | 605 |
| 607 QuicPacketNumber packet_number_of_last_sent_packet() const { | 606 QuicPacketNumber packet_number_of_last_sent_packet() const { |
| 608 return packet_number_of_last_sent_packet_; | 607 return packet_number_of_last_sent_packet_; |
| 609 } | 608 } |
| 610 | 609 |
| 611 QuicPacketWriter* writer() { return writer_; } | 610 QuicPacketWriter* writer() { return writer_; } |
| 612 const QuicPacketWriter* writer() const { return writer_; } | 611 const QuicPacketWriter* writer() const { return writer_; } |
| 613 | 612 |
| 614 bool is_secure() const { return is_secure_; } | |
| 615 | |
| 616 // Sends an MTU discovery packet of size |target_mtu|. If the packet is | 613 // Sends an MTU discovery packet of size |target_mtu|. If the packet is |
| 617 // acknowledged by the peer, the maximum packet size will be increased to | 614 // acknowledged by the peer, the maximum packet size will be increased to |
| 618 // |target_mtu|. | 615 // |target_mtu|. |
| 619 void SendMtuDiscoveryPacket(QuicByteCount target_mtu); | 616 void SendMtuDiscoveryPacket(QuicByteCount target_mtu); |
| 620 | 617 |
| 621 // Sends an MTU discovery packet of size |mtu_discovery_target_| and updates | 618 // Sends an MTU discovery packet of size |mtu_discovery_target_| and updates |
| 622 // the MTU discovery alarm. | 619 // the MTU discovery alarm. |
| 623 void DiscoverMtu(); | 620 void DiscoverMtu(); |
| 624 | 621 |
| 625 // Return the name of the cipher of the primary decrypter of the framer. | 622 // Return the name of the cipher of the primary decrypter of the framer. |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 bool self_port_changed_; | 938 bool self_port_changed_; |
| 942 | 939 |
| 943 // Set to false if the connection should not send truncated connection IDs to | 940 // Set to false if the connection should not send truncated connection IDs to |
| 944 // the peer, even if the peer supports it. | 941 // the peer, even if the peer supports it. |
| 945 bool can_truncate_connection_ids_; | 942 bool can_truncate_connection_ids_; |
| 946 | 943 |
| 947 // If non-empty this contains the set of versions received in a | 944 // If non-empty this contains the set of versions received in a |
| 948 // version negotiation packet. | 945 // version negotiation packet. |
| 949 QuicVersionVector server_supported_versions_; | 946 QuicVersionVector server_supported_versions_; |
| 950 | 947 |
| 951 // True if this is a secure QUIC connection. | |
| 952 bool is_secure_; | |
| 953 | |
| 954 // The size of the packet we are targeting while doing path MTU discovery. | 948 // The size of the packet we are targeting while doing path MTU discovery. |
| 955 QuicByteCount mtu_discovery_target_; | 949 QuicByteCount mtu_discovery_target_; |
| 956 | 950 |
| 957 // The number of MTU probes already sent. | 951 // The number of MTU probes already sent. |
| 958 size_t mtu_probe_count_; | 952 size_t mtu_probe_count_; |
| 959 | 953 |
| 960 // The number of packets between MTU probes. | 954 // The number of packets between MTU probes. |
| 961 QuicPacketCount packets_between_mtu_probes_; | 955 QuicPacketCount packets_between_mtu_probes_; |
| 962 | 956 |
| 963 // The packet number of the packet after which the next MTU probe will be | 957 // The packet number of the packet after which the next MTU probe will be |
| 964 // sent. | 958 // sent. |
| 965 QuicPacketNumber next_mtu_probe_at_; | 959 QuicPacketNumber next_mtu_probe_at_; |
| 966 | 960 |
| 967 // The size of the largest packet received from peer. | 961 // The size of the largest packet received from peer. |
| 968 QuicByteCount largest_received_packet_size_; | 962 QuicByteCount largest_received_packet_size_; |
| 969 | 963 |
| 970 // Whether a GoAway has been sent. | 964 // Whether a GoAway has been sent. |
| 971 bool goaway_sent_; | 965 bool goaway_sent_; |
| 972 | 966 |
| 973 // Whether a GoAway has been received. | 967 // Whether a GoAway has been received. |
| 974 bool goaway_received_; | 968 bool goaway_received_; |
| 975 | 969 |
| 976 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 970 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 977 }; | 971 }; |
| 978 | 972 |
| 979 } // namespace net | 973 } // namespace net |
| 980 | 974 |
| 981 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 975 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |