Skip to content

Single connection #8

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

Merged
merged 5 commits into from
Jan 8, 2019
Merged

Single connection #8

merged 5 commits into from
Jan 8, 2019

Conversation

xowor
Copy link
Collaborator

@xowor xowor commented Dec 20, 2018

Drop the multiple connections feature.
At this moment, it makes no sense for a single user to create multiple connections to IoT Cloud, since the messages for all the things comes through the same single connection. Creating connections for multiple users at the moment is not supported anyway, because there is no way to authenticate with different tokens, and the profile API is called for the currently authenticated user.
Creating multiple connections for the same user is still possible, but may create confusing situations where some of them are in a connected status and others aren't.
This PR enforces the creation of a single connection at time, requiring to close the currently opened one before opening a new one.
An updateToken function is added to allow simplify the token upgrade process, without requiring the ArduinoIoTJs user to close and reopen the connection when the authentication token is expired.

@xowor xowor requested a review from eclipse1985 December 20, 2018 08:32
@eclipse1985 eclipse1985 merged commit 2de29a1 into master Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants