Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add checkConnections service #139

Merged
merged 1 commit into from Aug 21, 2019
Merged

Conversation

afrokick
Copy link
Member

@afrokick afrokick commented Aug 21, 2019

  • fix tests
  • add new feature 'broken connections checker'
  • new alive_timeout parameter

I set alive_timeout to 60sec because currently PeerJS client send ping message every 20sec.

So, this feature works only with PeerJS 1.0.0+ (with ping function)

I'm going to add pingInterval option to PeerJS config.

How it works

  1. Server save last ping timestamp to Client#lastPing
  2. a new service checkBrokenConnections check every 300ms that nowTime - lastPing > alive_timeout. When it true - client disconnected from the server.

@afrokick
Copy link
Member Author

afrokick commented Aug 21, 2019

It should fix #4 and #89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant