| 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 // cannot be written immediately. | 651 // cannot be written immediately. |
| 652 virtual void SendOrQueuePacket(QueuedPacket packet); | 652 virtual void SendOrQueuePacket(QueuedPacket packet); |
| 653 | 653 |
| 654 QuicConnectionHelperInterface* helper() { return helper_; } | 654 QuicConnectionHelperInterface* helper() { return helper_; } |
| 655 | 655 |
| 656 // Selects and updates the version of the protocol being used by selecting a | 656 // Selects and updates the version of the protocol being used by selecting a |
| 657 // version from |available_versions| which is also supported. Returns true if | 657 // version from |available_versions| which is also supported. Returns true if |
| 658 // such a version exists, false otherwise. | 658 // such a version exists, false otherwise. |
| 659 bool SelectMutualVersion(const QuicVersionVector& available_versions); | 659 bool SelectMutualVersion(const QuicVersionVector& available_versions); |
| 660 | 660 |
| 661 bool peer_ip_changed() const { return peer_ip_changed_; } |
| 662 |
| 661 bool peer_port_changed() const { return peer_port_changed_; } | 663 bool peer_port_changed() const { return peer_port_changed_; } |
| 662 | 664 |
| 663 private: | 665 private: |
| 664 friend class test::QuicConnectionPeer; | 666 friend class test::QuicConnectionPeer; |
| 665 friend class test::PacketSavingConnection; | 667 friend class test::PacketSavingConnection; |
| 666 | 668 |
| 667 typedef std::list<QueuedPacket> QueuedPacketList; | 669 typedef std::list<QueuedPacket> QueuedPacketList; |
| 668 typedef std::map<QuicFecGroupNumber, QuicFecGroup*> FecGroupMap; | 670 typedef std::map<QuicFecGroupNumber, QuicFecGroup*> FecGroupMap; |
| 669 | 671 |
| 670 // Writes the given packet to socket, encrypted with packet's | 672 // Writes the given packet to socket, encrypted with packet's |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 QuicPacketNumber first_required_forward_secure_packet_; | 786 QuicPacketNumber first_required_forward_secure_packet_; |
| 785 const QuicClock* clock_; | 787 const QuicClock* clock_; |
| 786 QuicRandom* random_generator_; | 788 QuicRandom* random_generator_; |
| 787 | 789 |
| 788 const QuicConnectionId connection_id_; | 790 const QuicConnectionId connection_id_; |
| 789 // Address on the last successfully processed packet received from the | 791 // Address on the last successfully processed packet received from the |
| 790 // client. | 792 // client. |
| 791 IPEndPoint self_address_; | 793 IPEndPoint self_address_; |
| 792 IPEndPoint peer_address_; | 794 IPEndPoint peer_address_; |
| 793 | 795 |
| 794 // TODO(fayang): Use migrating_peer_address_ instead of migrating_peer_ip_ | |
| 795 // and migrating_peer_port_ once FLAGS_quic_allow_ip_migration is deprecated. | |
| 796 // Used to store latest peer IP address for IP address migration. | 796 // Used to store latest peer IP address for IP address migration. |
| 797 IPAddressNumber migrating_peer_ip_; | 797 IPAddressNumber migrating_peer_ip_; |
| 798 // Used to store latest peer port to possibly migrate to later. | 798 // Used to store latest peer port to possibly migrate to later. |
| 799 uint16 migrating_peer_port_; | 799 uint16 migrating_peer_port_; |
| 800 | 800 |
| 801 // True if the last packet has gotten far enough in the framer to be | 801 // True if the last packet has gotten far enough in the framer to be |
| 802 // decrypted. | 802 // decrypted. |
| 803 bool last_packet_decrypted_; | 803 bool last_packet_decrypted_; |
| 804 bool last_packet_revived_; // True if the last packet was revived from FEC. | 804 bool last_packet_revived_; // True if the last packet was revived from FEC. |
| 805 QuicByteCount last_size_; // Size of the last received packet. | 805 QuicByteCount last_size_; // Size of the last received packet. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 QuicVersionNegotiationState version_negotiation_state_; | 921 QuicVersionNegotiationState version_negotiation_state_; |
| 922 | 922 |
| 923 // Tracks if the connection was created by the server or the client. | 923 // Tracks if the connection was created by the server or the client. |
| 924 Perspective perspective_; | 924 Perspective perspective_; |
| 925 | 925 |
| 926 // True by default. False if we've received or sent an explicit connection | 926 // True by default. False if we've received or sent an explicit connection |
| 927 // close. | 927 // close. |
| 928 bool connected_; | 928 bool connected_; |
| 929 | 929 |
| 930 // Set to true if the UDP packet headers have a new IP address for the peer. | 930 // Set to true if the UDP packet headers have a new IP address for the peer. |
| 931 // If true, do not perform connection migration. | |
| 932 bool peer_ip_changed_; | 931 bool peer_ip_changed_; |
| 933 | 932 |
| 934 // Set to true if the UDP packet headers have a new port for the peer. | 933 // Set to true if the UDP packet headers have a new port for the peer. |
| 935 // If true, and the IP has not changed, then we can migrate the connection. | |
| 936 bool peer_port_changed_; | 934 bool peer_port_changed_; |
| 937 | 935 |
| 938 // Set to true if the UDP packet headers are addressed to a different IP. | 936 // Set to true if the UDP packet headers are addressed to a different IP. |
| 939 // We do not support connection migration when the self IP changed. | 937 // We do not support connection migration when the self IP changed. |
| 940 bool self_ip_changed_; | 938 bool self_ip_changed_; |
| 941 | 939 |
| 942 // Set to true if the UDP packet headers are addressed to a different port. | 940 // Set to true if the UDP packet headers are addressed to a different port. |
| 943 // We do not support connection migration when the self port changed. | 941 // We do not support connection migration when the self port changed. |
| 944 bool self_port_changed_; | 942 bool self_port_changed_; |
| 945 | 943 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 975 | 973 |
| 976 // Whether a GoAway has been received. | 974 // Whether a GoAway has been received. |
| 977 bool goaway_received_; | 975 bool goaway_received_; |
| 978 | 976 |
| 979 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 977 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 980 }; | 978 }; |
| 981 | 979 |
| 982 } // namespace net | 980 } // namespace net |
| 983 | 981 |
| 984 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 982 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |