Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: net/spdy/spdy_session.h

Issue 8497063: Send preface-PING message once in 10 secs and send PING (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/spdy/spdy_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_SPDY_SPDY_SESSION_H_ 5 #ifndef NET_SPDY_SPDY_SESSION_H_
6 #define NET_SPDY_SPDY_SESSION_H_ 6 #define NET_SPDY_SPDY_SESSION_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <list> 10 #include <list>
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 virtual bool OnControlFrameHeaderData(spdy::SpdyStreamId stream_id, 389 virtual bool OnControlFrameHeaderData(spdy::SpdyStreamId stream_id,
390 const char* header_data, 390 const char* header_data,
391 size_t len); 391 size_t len);
392 392
393 virtual void OnDataFrameHeader(const spdy::SpdyDataFrame* frame); 393 virtual void OnDataFrameHeader(const spdy::SpdyDataFrame* frame);
394 394
395 // -------------------------- 395 // --------------------------
396 // Helper methods for testing 396 // Helper methods for testing
397 // -------------------------- 397 // --------------------------
398 static void set_connection_at_risk_of_loss_ms(int duration) { 398 static void set_connection_at_risk_of_loss_seconds(int duration) {
399 connection_at_risk_of_loss_ms_ = duration; 399 connection_at_risk_of_loss_seconds_ = duration;
400 } 400 }
401 static int connection_at_risk_of_loss_ms() { 401 static int connection_at_risk_of_loss_seconds() {
402 return connection_at_risk_of_loss_ms_; 402 return connection_at_risk_of_loss_seconds_;
403 } 403 }
404 404
405 static void set_trailing_ping_delay_time_ms(int duration) { 405 static void set_trailing_ping_delay_time_ms(int duration) {
406 trailing_ping_delay_time_ms_ = duration; 406 trailing_ping_delay_time_ms_ = duration;
407 } 407 }
408 static int trailing_ping_delay_time_ms() { 408 static int trailing_ping_delay_time_ms() {
409 return trailing_ping_delay_time_ms_; 409 return trailing_ping_delay_time_ms_;
410 } 410 }
411 411
412 static void set_hung_interval_ms(int duration) { 412 static void set_hung_interval_ms(int duration) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 bool verify_domain_authentication_; 557 bool verify_domain_authentication_;
558 558
559 static bool use_ssl_; 559 static bool use_ssl_;
560 static bool use_flow_control_; 560 static bool use_flow_control_;
561 static size_t init_max_concurrent_streams_; 561 static size_t init_max_concurrent_streams_;
562 static size_t max_concurrent_stream_limit_; 562 static size_t max_concurrent_stream_limit_;
563 563
564 // This enables or disables connection health checking system. 564 // This enables or disables connection health checking system.
565 static bool enable_ping_based_connection_checking_; 565 static bool enable_ping_based_connection_checking_;
566 566
567 // |connection_at_risk_of_loss_ms_| is an optimization to avoid sending 567 // |connection_at_risk_of_loss_seconds_| is an optimization to avoid sending
568 // wasteful preface pings (when we just got some data). 568 // wasteful preface pings (when we just got some data).
569 // 569 //
570 // If it is zero (the most conservative figure), then we always send the 570 // If it is zero (the most conservative figure), then we always send the
571 // preface ping (when none are in flight). 571 // preface ping (when none are in flight).
572 // 572 //
573 // It is common for TCP/IP sessions to time out in about 3-5 minutes. 573 // It is common for TCP/IP sessions to time out in about 3-5 minutes.
574 // Certainly if it has been more than 3 minutes, we do want to send a preface 574 // Certainly if it has been more than 3 minutes, we do want to send a preface
575 // ping. 575 // ping.
576 // 576 //
577 // We don't think any connection will time out in under about 10 seconds. So 577 // We don't think any connection will time out in under about 10 seconds. So
578 // this might as well be set to something conservative like 10 seconds. Later, 578 // this might as well be set to something conservative like 10 seconds. Later,
579 // we could adjust it to send fewer pings perhaps. 579 // we could adjust it to send fewer pings perhaps.
580 static int connection_at_risk_of_loss_ms_; 580 static int connection_at_risk_of_loss_seconds_;
581 581
582 // This is the amount of time (in milliseconds) we wait before sending a 582 // This is the amount of time (in milliseconds) we wait before sending a
583 // trailing ping. We use a trailing ping (sent after all data) to get an 583 // trailing ping. We use a trailing ping (sent after all data) to get an
584 // effective acknowlegement from the server that it has indeed received all 584 // effective acknowlegement from the server that it has indeed received all
585 // (prior) data frames. With that assurance, we are willing to enter into a 585 // (prior) data frames. With that assurance, we are willing to enter into a
586 // wait state for responses to our last data frame(s) without further pings. 586 // wait state for responses to our last data frame(s) without further pings.
587 static int trailing_ping_delay_time_ms_; 587 static int trailing_ping_delay_time_ms_;
588 588
589 // The amount of time (in milliseconds) that we are willing to tolerate with 589 // The amount of time (in milliseconds) that we are willing to tolerate with
590 // no data received (of any form), while there is a ping in flight, before we 590 // no data received (of any form), while there is a ping in flight, before we
(...skipping 21 matching lines...) Expand all
612 const spdy::SpdyControlFlags flags_; 612 const spdy::SpdyControlFlags flags_;
613 const spdy::SpdyStreamId id_; 613 const spdy::SpdyStreamId id_;
614 const spdy::SpdyStreamId associated_stream_; 614 const spdy::SpdyStreamId associated_stream_;
615 615
616 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); 616 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter);
617 }; 617 };
618 618
619 } // namespace net 619 } // namespace net
620 620
621 #endif // NET_SPDY_SPDY_SESSION_H_ 621 #endif // NET_SPDY_SPDY_SESSION_H_
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698