teamspeak-query
teamspeak-query copied to clipboard
Reconnect feature
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)
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 :)
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.
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
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
[...] 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.
@schroffl <3
Hi @schroffl you didn't pull new version on npm)
Are you referring to #13?
Yes on NPM not latest version of package
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.