| 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 void OnHandshakeComplete(); | 476 void OnHandshakeComplete(); |
| 477 | 477 |
| 478 // Accessors | 478 // Accessors |
| 479 void set_visitor(QuicConnectionVisitorInterface* visitor) { | 479 void set_visitor(QuicConnectionVisitorInterface* visitor) { |
| 480 visitor_ = visitor; | 480 visitor_ = visitor; |
| 481 } | 481 } |
| 482 void set_debug_visitor(QuicConnectionDebugVisitor* debug_visitor) { | 482 void set_debug_visitor(QuicConnectionDebugVisitor* debug_visitor) { |
| 483 debug_visitor_ = debug_visitor; | 483 debug_visitor_ = debug_visitor; |
| 484 sent_packet_manager_->SetDebugDelegate(debug_visitor); | 484 sent_packet_manager_->SetDebugDelegate(debug_visitor); |
| 485 } | 485 } |
| 486 void set_ping_timeout(QuicTime::Delta ping_timeout) { |
| 487 ping_timeout_ = ping_timeout; |
| 488 } |
| 489 const QuicTime::Delta ping_timeout() { return ping_timeout_; } |
| 486 // Used in Chromium, but not internally. | 490 // Used in Chromium, but not internally. |
| 487 void set_creator_debug_delegate(QuicPacketCreator::DebugDelegate* visitor) { | 491 void set_creator_debug_delegate(QuicPacketCreator::DebugDelegate* visitor) { |
| 488 packet_generator_.set_debug_delegate(visitor); | 492 packet_generator_.set_debug_delegate(visitor); |
| 489 } | 493 } |
| 490 const IPEndPoint& self_address() const { return self_address_; } | 494 const IPEndPoint& self_address() const { return self_address_; } |
| 491 const IPEndPoint& peer_address() const { return peer_address_; } | 495 const IPEndPoint& peer_address() const { return peer_address_; } |
| 492 QuicConnectionId connection_id() const { return connection_id_; } | 496 QuicConnectionId connection_id() const { return connection_id_; } |
| 493 const QuicClock* clock() const { return clock_; } | 497 const QuicClock* clock() const { return clock_; } |
| 494 QuicRandom* random_generator() const { return random_generator_; } | 498 QuicRandom* random_generator() const { return random_generator_; } |
| 495 QuicByteCount max_packet_length() const; | 499 QuicByteCount max_packet_length() const; |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 // Indicates the retransmit alarm is going to be set by the | 976 // Indicates the retransmit alarm is going to be set by the |
| 973 // ScopedRetransmitAlarmDelayer | 977 // ScopedRetransmitAlarmDelayer |
| 974 bool delay_setting_retransmission_alarm_; | 978 bool delay_setting_retransmission_alarm_; |
| 975 // Indicates the retransmission alarm needs to be set. | 979 // Indicates the retransmission alarm needs to be set. |
| 976 bool pending_retransmission_alarm_; | 980 bool pending_retransmission_alarm_; |
| 977 | 981 |
| 978 // If true, defer sending data in response to received packets to the | 982 // If true, defer sending data in response to received packets to the |
| 979 // SendAlarm. | 983 // SendAlarm. |
| 980 bool defer_send_in_response_to_packets_; | 984 bool defer_send_in_response_to_packets_; |
| 981 | 985 |
| 986 // The timeout for PING. |
| 987 QuicTime::Delta ping_timeout_; |
| 988 |
| 982 // Arena to store class implementations within the QuicConnection. | 989 // Arena to store class implementations within the QuicConnection. |
| 983 QuicConnectionArena arena_; | 990 QuicConnectionArena arena_; |
| 984 | 991 |
| 985 // An alarm that fires when an ACK should be sent to the peer. | 992 // An alarm that fires when an ACK should be sent to the peer. |
| 986 QuicArenaScopedPtr<QuicAlarm> ack_alarm_; | 993 QuicArenaScopedPtr<QuicAlarm> ack_alarm_; |
| 987 // An alarm that fires when a packet needs to be retransmitted. | 994 // An alarm that fires when a packet needs to be retransmitted. |
| 988 QuicArenaScopedPtr<QuicAlarm> retransmission_alarm_; | 995 QuicArenaScopedPtr<QuicAlarm> retransmission_alarm_; |
| 989 // An alarm that is scheduled when the SentPacketManager requires a delay | 996 // An alarm that is scheduled when the SentPacketManager requires a delay |
| 990 // before sending packets and fires when the packet may be sent. | 997 // before sending packets and fires when the packet may be sent. |
| 991 QuicArenaScopedPtr<QuicAlarm> send_alarm_; | 998 QuicArenaScopedPtr<QuicAlarm> send_alarm_; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 // Indicates whether a write error is encountered currently. This is used to | 1105 // Indicates whether a write error is encountered currently. This is used to |
| 1099 // avoid infinite write errors. | 1106 // avoid infinite write errors. |
| 1100 bool write_error_occured_; | 1107 bool write_error_occured_; |
| 1101 | 1108 |
| 1102 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 1109 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 1103 }; | 1110 }; |
| 1104 | 1111 |
| 1105 } // namespace net | 1112 } // namespace net |
| 1106 | 1113 |
| 1107 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 1114 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |