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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 void set_debug_visitor(QuicConnectionDebugVisitor* debug_visitor) { | 353 void set_debug_visitor(QuicConnectionDebugVisitor* debug_visitor) { |
354 debug_visitor_ = debug_visitor; | 354 debug_visitor_ = debug_visitor; |
355 packet_generator_.set_debug_delegate(debug_visitor); | 355 packet_generator_.set_debug_delegate(debug_visitor); |
356 sent_packet_manager_.set_debug_delegate(debug_visitor); | 356 sent_packet_manager_.set_debug_delegate(debug_visitor); |
357 } | 357 } |
358 const IPEndPoint& self_address() const { return self_address_; } | 358 const IPEndPoint& self_address() const { return self_address_; } |
359 const IPEndPoint& peer_address() const { return peer_address_; } | 359 const IPEndPoint& peer_address() const { return peer_address_; } |
360 QuicConnectionId connection_id() const { return connection_id_; } | 360 QuicConnectionId connection_id() const { return connection_id_; } |
361 const QuicClock* clock() const { return clock_; } | 361 const QuicClock* clock() const { return clock_; } |
362 QuicRandom* random_generator() const { return random_generator_; } | 362 QuicRandom* random_generator() const { return random_generator_; } |
363 size_t max_packet_length() const { | 363 size_t max_packet_length() const; |
364 return packet_creator_.max_packet_length(); | 364 void set_max_packet_length(size_t length); |
365 } | |
366 void set_max_packet_length(size_t length) { | |
367 return packet_creator_.set_max_packet_length(length); | |
368 } | |
369 | 365 |
370 bool connected() const { return connected_; } | 366 bool connected() const { return connected_; } |
371 | 367 |
372 // Must only be called on client connections. | 368 // Must only be called on client connections. |
373 const QuicVersionVector& server_supported_versions() const { | 369 const QuicVersionVector& server_supported_versions() const { |
374 DCHECK(!is_server_); | 370 DCHECK(!is_server_); |
375 return server_supported_versions_; | 371 return server_supported_versions_; |
376 } | 372 } |
377 | 373 |
378 size_t NumFecGroups() const { return group_map_.size(); } | 374 size_t NumFecGroups() const { return group_map_.size(); } |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 // An alarm that is scheduled when the connection can still write and there | 695 // An alarm that is scheduled when the connection can still write and there |
700 // may be more data to send. | 696 // may be more data to send. |
701 scoped_ptr<QuicAlarm> resume_writes_alarm_; | 697 scoped_ptr<QuicAlarm> resume_writes_alarm_; |
702 // An alarm that fires when the connection may have timed out. | 698 // An alarm that fires when the connection may have timed out. |
703 scoped_ptr<QuicAlarm> timeout_alarm_; | 699 scoped_ptr<QuicAlarm> timeout_alarm_; |
704 // An alarm that fires when a ping should be sent. | 700 // An alarm that fires when a ping should be sent. |
705 scoped_ptr<QuicAlarm> ping_alarm_; | 701 scoped_ptr<QuicAlarm> ping_alarm_; |
706 | 702 |
707 QuicConnectionVisitorInterface* visitor_; | 703 QuicConnectionVisitorInterface* visitor_; |
708 QuicConnectionDebugVisitor* debug_visitor_; | 704 QuicConnectionDebugVisitor* debug_visitor_; |
709 QuicPacketCreator packet_creator_; | |
710 QuicPacketGenerator packet_generator_; | 705 QuicPacketGenerator packet_generator_; |
711 | 706 |
712 // Network idle time before we kill of this connection. | 707 // Network idle time before we kill of this connection. |
713 QuicTime::Delta idle_network_timeout_; | 708 QuicTime::Delta idle_network_timeout_; |
714 // Overall connection timeout. | 709 // Overall connection timeout. |
715 QuicTime::Delta overall_connection_timeout_; | 710 QuicTime::Delta overall_connection_timeout_; |
716 | 711 |
717 // Statistics for this session. | 712 // Statistics for this session. |
718 QuicConnectionStats stats_; | 713 QuicConnectionStats stats_; |
719 | 714 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 // If non-empty this contains the set of versions received in a | 758 // If non-empty this contains the set of versions received in a |
764 // version negotiation packet. | 759 // version negotiation packet. |
765 QuicVersionVector server_supported_versions_; | 760 QuicVersionVector server_supported_versions_; |
766 | 761 |
767 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 762 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
768 }; | 763 }; |
769 | 764 |
770 } // namespace net | 765 } // namespace net |
771 | 766 |
772 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 767 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |