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 // Used in Chromium, but not internally. | |
487 // Must only be called before ping_alarm_ is set. | |
488 void set_ping_timeout(QuicTime::Delta ping_timeout) { | 486 void set_ping_timeout(QuicTime::Delta ping_timeout) { |
489 DCHECK(!ping_alarm_->IsSet()); | |
490 ping_timeout_ = ping_timeout; | 487 ping_timeout_ = ping_timeout; |
491 } | 488 } |
492 const QuicTime::Delta ping_timeout() { return ping_timeout_; } | 489 const QuicTime::Delta ping_timeout() { return ping_timeout_; } |
| 490 // Used in Chromium, but not internally. |
493 void set_creator_debug_delegate(QuicPacketCreator::DebugDelegate* visitor) { | 491 void set_creator_debug_delegate(QuicPacketCreator::DebugDelegate* visitor) { |
494 packet_generator_.set_debug_delegate(visitor); | 492 packet_generator_.set_debug_delegate(visitor); |
495 } | 493 } |
496 const IPEndPoint& self_address() const { return self_address_; } | 494 const IPEndPoint& self_address() const { return self_address_; } |
497 const IPEndPoint& peer_address() const { return peer_address_; } | 495 const IPEndPoint& peer_address() const { return peer_address_; } |
498 QuicConnectionId connection_id() const { return connection_id_; } | 496 QuicConnectionId connection_id() const { return connection_id_; } |
499 const QuicClock* clock() const { return clock_; } | 497 const QuicClock* clock() const { return clock_; } |
500 QuicRandom* random_generator() const { return random_generator_; } | 498 QuicRandom* random_generator() const { return random_generator_; } |
501 QuicByteCount max_packet_length() const; | 499 QuicByteCount max_packet_length() const; |
502 void SetMaxPacketLength(QuicByteCount length); | 500 void SetMaxPacketLength(QuicByteCount length); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 // 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 |
1108 // avoid infinite write errors. | 1106 // avoid infinite write errors. |
1109 bool write_error_occured_; | 1107 bool write_error_occured_; |
1110 | 1108 |
1111 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 1109 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
1112 }; | 1110 }; |
1113 | 1111 |
1114 } // namespace net | 1112 } // namespace net |
1115 | 1113 |
1116 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 1114 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |