Chromium Code Reviews| Index: remoting/protocol/jingle_session.cc |
| diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc |
| index aac04846a5e8ba356344f7537ae490b3b8b7de94..ed0f0a69d115cb4c4f940eb3733186511bf4dd68 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. |
|
Wez
2011/06/28 19:27:18
nit: It's chosen to balance the extra latency agai
|
| +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->SetNoDelay(false); |
| + |
| + stream->reset(adapter); |
| int result = (*stream)->Connect(&connect_callback_); |
| return (result == net::OK) || (result == net::ERR_IO_PENDING); |
| } |