teamspeak-query
teamspeak-query copied to clipboard
Timeout for single commands
This is extracted from an issue (#22) by @winterwings
[...] I would also like to see request timeouts when a connection is not lost, but there was no response for some reason. (Happened this spring when hosting in France lost connection to London and their second router didn't really handle the huge traffic spike. Very slow connection and frequent packet losses as a result.) [...]
Hey @winterwings, is there a specific API you wish for? Do you want to be able to set the timeout per-command like this query.sendTimeout(5000, 'my-command', 'params').
Perhaps something simpler like query.setTimeout(5000)?
I don't see a case where you want to have an individual timeout per command. It would make the code kinda messy or I would have to make a wrapper for it like query.sendsafe = ...args => query.sendTimeout(5000, ...args) which is not a big deal, but... :)