[Pkg-javascript-commits] [sockjs-client] 18/350: Slightly increase the value of the retransmission timeout
tonnerre at ancient-solutions.com
tonnerre at ancient-solutions.com
Fri Aug 5 01:03:36 UTC 2016
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.
commit a12275e671632f53edd8017c4b59c41065c4cb51
Author: Luigi Pinca <luigipinca at gmail.com>
Date: Tue Mar 25 12:43:13 2014 +0100
Slightly increase the value of the retransmission timeout
---
lib/utils.js | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/lib/utils.js b/lib/utils.js
index 7efed84..3c7ecf8 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -86,14 +86,15 @@ utils.userSetCode = function (code) {
// See: http://www.erg.abdn.ac.uk/~gerrit/dccp/notes/ccid2/rto_estimator/
// and RFC 2988.
utils.countRTO = function (rtt) {
- var rto;
- if (rtt > 100) {
- rto = 3 * rtt; // rto > 300msec
- } else {
- rto = rtt + 200; // 200msec < rto <= 300msec
- }
- return rto;
-}
+ // In a local environment, when using IE8/9 and the `jsonp-polling`
+ // transport the time needed to establish a connection (the time that pass
+ // from the opening of the transport to the call of `_dispatchOpen`) is
+ // around 200msec (the lower bound used in the article above) and this
+ // causes spurious timeouts. For this reason we calculate a value slightly
+ // larger than that used in the article.
+ if (rtt > 100) return 4 * rtt; // rto > 400msec
+ return 300 + rtt; // 300msec < rto <= 400msec
+};
utils.log = function() {
if (_window.console && console.log && console.log.apply) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list