diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 19:29:34 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 19:29:34 +0000 |
commit | 891120aad39e8e9c25a128b8aea3eb359b6b246d (patch) | |
tree | 6ff01a643aaab9088533803e602ea69729234ad2 /remoting/protocol/jingle_session.cc | |
parent | 01f0096398f34b3b83843d012f330d4ed3c54089 (diff) | |
download | chromium_src-891120aad39e8e9c25a128b8aea3eb359b6b246d.zip chromium_src-891120aad39e8e9c25a128b8aea3eb359b6b246d.tar.gz chromium_src-891120aad39e8e9c25a128b8aea3eb359b6b246d.tar.bz2 |
Configure Nagle's & Delayed ACK settings for Chromoting channels.
BUG=74944
TEST=See bug description.
Review URL: http://codereview.chromium.org/6621027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77167 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/jingle_session.cc')
-rw-r--r-- | remoting/protocol/jingle_session.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc index 74ed354..f1ae62c 100644 --- a/remoting/protocol/jingle_session.cc +++ b/remoting/protocol/jingle_session.cc @@ -25,6 +25,7 @@ #include "third_party/libjingle/source/talk/session/tunnel/pseudotcpchannel.h" using cricket::BaseSession; +using cricket::PseudoTcp; using cricket::PseudoTcpChannel; namespace remoting { @@ -40,6 +41,12 @@ const char kVideoChannelName[] = "video"; const char kVideoRtpChannelName[] = "videortp"; const char kVideoRtcpChannelName[] = "videortcp"; +// Settings to apply to PseudoTcp channels for Control, Input and Video. +// Disable Nagle's algorithm, to reduce latency for small messages. +// Reduce the ACK Delay to 10ms, to balance throughput/latency with overhead. +const int kEnableNoDelay = true; +const int kDelayedAckTimeoutMs = 10; + // Helper method to create a SSL client socket. net::SSLClientSocket* CreateSSLClientSocket( net::ClientSocket* socket, scoped_refptr<net::X509Certificate> cert, @@ -366,6 +373,8 @@ void JingleSession::OnInitiate() { control_channel_ = new PseudoTcpChannel( jingle_session_manager_->jingle_thread(), cricket_session_); control_channel_->Connect(content_name, kControlChannelName); + control_channel_->SetOption(PseudoTcp::OPT_NODELAY, kEnableNoDelay); + control_channel_->SetOption(PseudoTcp::OPT_ACKDELAY, kDelayedAckTimeoutMs); control_channel_adapter_.reset(new StreamSocketAdapter( control_channel_->GetStream())); @@ -373,6 +382,8 @@ void JingleSession::OnInitiate() { event_channel_ = new PseudoTcpChannel( jingle_session_manager_->jingle_thread(), cricket_session_); event_channel_->Connect(content_name, kEventChannelName); + event_channel_->SetOption(PseudoTcp::OPT_NODELAY, kEnableNoDelay); + event_channel_->SetOption(PseudoTcp::OPT_ACKDELAY, kDelayedAckTimeoutMs); event_channel_adapter_.reset(new StreamSocketAdapter( event_channel_->GetStream())); @@ -381,6 +392,8 @@ void JingleSession::OnInitiate() { video_channel_ = new PseudoTcpChannel( jingle_session_manager_->jingle_thread(), cricket_session_); video_channel_->Connect(content_name, kVideoChannelName); + video_channel_->SetOption(PseudoTcp::OPT_NODELAY, kEnableNoDelay); + video_channel_->SetOption(PseudoTcp::OPT_ACKDELAY, kDelayedAckTimeoutMs); video_channel_adapter_.reset(new StreamSocketAdapter( video_channel_->GetStream())); |