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

Reconnect feature #14

Open
frct1 opened this issue Jul 5, 2018 · 10 comments
Open

Reconnect feature #14

frct1 opened this issue Jul 5, 2018 · 10 comments

Comments

@frct1
Copy link

frct1 commented Jul 5, 2018

Hello @schroffl, have a feature idea: reconnect, when we get query.sock **end** event.

I'm currently building real time app with meteor and your package. Autoreconnect attempts would be cool. My logic seems as fuck. I think you can do it much better. How do you look at this?
For example: if we get end event get reconnect attempts for time or some count with interval between attempts. Have a nice day)

@schroffl
Copy link
Owner

schroffl commented Jul 5, 2018

I'm not sure about this, because currently the library doesn't maintain any context. If I were to implement automatic reconnection, then stateful commands like login or use had to be kept track of. What these commands are and what not always depends on the specific situation of a user, so it's nothing you could generalize that easily.
But since I am currently rethinking the code in regards of #13 anyways, I will keep your proposal in mind and try to design accordingly :)

@schroffl
Copy link
Owner

schroffl commented Jul 9, 2018

Hey, what use case do you have for the auto-reconnect? Does the keep-alive (See #9) not work for you?
As I already said, building a generalized solution is really hard, if not impossible, because of all the state the teamspeak server maintains for a query client.

@frct1
Copy link
Author

frct1 commented Jul 9, 2018

Hi, currently for bot-writing and some other stuff, which need uptime.
For example, if we have network issues and our connection is being dropped we need try to reconnect;
Similar situation if we need to restart (or update and etc.) ts3 instance all SQ connections is being dropped, but if we have reconnect feature we must not worry about it

@frct1
Copy link
Author

frct1 commented Jul 9, 2018

I have implement that with end event and api call to resource where store the connection and recursively attempts to connection (every second for example). But i think there is can do better

@schroffl
Copy link
Owner

[...] if we have network issues and our connection is being dropped [or] if we need to restart [...]

Oh right, I didn't even think of that. I will see if I can come up with a nice way to integrate your proposal into the library. Preferably, in my opinion, the user should stay in full control of the actual reconnect (+ setup) and the potential backoff strategy, but I can make some adjustments to improve the reusability of query clients.

@frct1
Copy link
Author

frct1 commented Jul 11, 2018

@schroffl <3

@frct1
Copy link
Author

frct1 commented Jul 13, 2018

Hi @schroffl you didn't pull new version on npm)

@schroffl
Copy link
Owner

Are you referring to #13?

@frct1
Copy link
Author

frct1 commented Jul 14, 2018

Yes on NPM not latest version of package

@schroffl
Copy link
Owner

As I said in #15 I plan on publishing a pre-release version which will then be fully released when the new Teamspeak Server version is officially out of beta.

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

No branches or pull requests

2 participants