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

Unified Diff: remoting/protocol/jingle_session.cc

Issue 7275024: PseudoTcp to expose settings of nagling and ACK delay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/jingle_session.cc
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index aac04846a5e8ba356344f7537ae490b3b8b7de94..1f4f0db6609d1f34cd2fdababa0315be62027331 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -45,6 +45,10 @@ const char kVideoRtcpChannelName[] = "videortcp";
const int kMasterKeyLength = 16;
const int kChannelKeyLength = 16;
+// 10 milliseconds of ACK delay is choosen to lower network latency
+// and don't overwhelm the network with ACK packets.
+const int kTcpAckDelayMilliseconds = 10;
+
// Helper method to create a SSL client socket.
net::SSLClientSocket* CreateSSLClientSocket(
net::StreamSocket* socket, scoped_refptr<net::X509Certificate> cert,
@@ -451,7 +455,12 @@ void JingleSession::OnInitiate() {
bool JingleSession::EstablishPseudoTcp(
net::Socket* channel,
scoped_ptr<net::StreamSocket>* stream) {
- stream->reset(new jingle_glue::PseudoTcpAdapter(channel));
+ jingle_glue::PseudoTcpAdapter* adapter =
+ new jingle_glue::PseudoTcpAdapter(channel);
+ adapter->SetAckDelay(kTcpAckDelayMilliseconds);
+ adapter->SetNagling(false);
+
+ stream->reset(adapter);
int result = (*stream)->Connect(&connect_callback_);
return (result == net::OK) || (result == net::ERR_IO_PENDING);
}

Powered by Google App Engine
This is Rietveld 408576698