mirror of
https://github.com/amark/gun.git
synced 2025-11-28 00:03:41 +00:00
commit
0ee3229cff
6
gun.js
6
gun.js
@ -1366,7 +1366,7 @@
|
|||||||
while(i--){ (r.createServer.s[i] || function(){})(req, cb) }
|
while(i--){ (r.createServer.s[i] || function(){})(req, cb) }
|
||||||
}
|
}
|
||||||
r.createServer.s = [];
|
r.createServer.s = [];
|
||||||
r.back = 2; r.backoff = 2;
|
r.back = 2; r.backoff = 2; r.backmax = 2000;
|
||||||
r.transport = function(opt, cb){
|
r.transport = function(opt, cb){
|
||||||
//Gun.log("TRANSPORT:", opt);
|
//Gun.log("TRANSPORT:", opt);
|
||||||
if(r.ws(opt, cb)){ return }
|
if(r.ws(opt, cb)){ return }
|
||||||
@ -1423,7 +1423,7 @@
|
|||||||
ws.onopen = function(o){
|
ws.onopen = function(o){
|
||||||
|
|
||||||
// Send the queued messages.
|
// Send the queued messages.
|
||||||
Gun.obj.map(queue, function (deferred) {
|
r.each(queue, function (deferred) {
|
||||||
r.ws.apply(null, deferred);
|
r.ws.apply(null, deferred);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1445,7 +1445,7 @@
|
|||||||
ws = r.ws.peers[opt.base] = null; // this will make the next request try to reconnect
|
ws = r.ws.peers[opt.base] = null; // this will make the next request try to reconnect
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
r.ws(opt, function(){}); // opt here is a race condition, is it not? Does this matter?
|
r.ws(opt, function(){}); // opt here is a race condition, is it not? Does this matter?
|
||||||
}, r.back *= r.backoff);
|
}, (r.back *= r.backoff) > r.backmax ? (r.back = r.backmax) : r.back);
|
||||||
};
|
};
|
||||||
if(typeof window !== "undefined"){ window.onbeforeunload = ws.onclose; }
|
if(typeof window !== "undefined"){ window.onbeforeunload = ws.onclose; }
|
||||||
ws.onmessage = function(m){
|
ws.onmessage = function(m){
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gun",
|
"name": "gun",
|
||||||
"version": "0.3.999",
|
"version": "0.3.9991",
|
||||||
"description": "Graph engine",
|
"description": "Graph engine",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user