Skip to content

Commit

Permalink
**connect** module bug fix (changed inital lastPing from null to `D…
Browse files Browse the repository at this point in the history
…ate.now()`)
  • Loading branch information
Y0ursTruly authored Jul 7, 2024
1 parent a5dba1c commit f26a2da
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion for_browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
authToken,
await coding.encoder( JSON.stringify([randomChar(32,""),Date.now()]) )
]))
let firstMsg=false, lastPing=null;
let firstMsg=false, lastPing=Date.now();
ping=setInterval(function(){
if(Date.now()-lastPing>2**15){
alreadyClosed=true //the close event gets called after so I want to prevent 2 events for 1 disconnection
Expand Down
2 changes: 1 addition & 1 deletion for_browser.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webject",
"version": "1.4.4",
"version": "1.4.41",
"description": "Share Objects Online with the power of websockets. Keys, Values AND references. Webject is short for Web Object and it really is a system for sharing objects on the web. Someone can host an object, and make authTokens for others online to share this object",
"main": "webject.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion webject.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
authToken,
await coding.encoder( JSON.stringify([randomChar(32,""),Date.now()]) )
]))
let firstMsg=false, lastPing=null;
let firstMsg=false, lastPing=Date.now();
ping=setInterval(function(){
if(Date.now()-lastPing>2**15){
alreadyClosed=true //the close event gets called after so I want to prevent 2 events for 1 disconnection
Expand Down

0 comments on commit f26a2da

Please sign in to comment.