FromLondon

Honk Honk
TeamSpeak Developer
VIP
May 20, 2016
264
107
136
Hello. Anyone work with teamspeak server through node js?
I`m testing this thing and have some problems: disconnection with server close after some idle time
Library for this: teamspeak-query
Get error:

Code:
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: This socket has been ended by the other party
    at Socket.writeAfterFIN [as write] (net.js:352:12)
    at throttle.run (C:\Users\LALALA\ts3Events\node_modules\teamspeak-query\index.js:67:15)
    at Map.run (C:\Users\LALALA\ts3Events\node_modules\teamspeak-query\lib\throttle.js:45:4)
    at TeamspeakQuery.checkQueue (C:\Users\LALALA\ts3Events\node_modules\teamspeak-query\index.js:64:17)
    at TeamspeakQuery.send (C:\Users\LALALA\ts3Events\node_modules\teamspeak-query\index.js:56:34)
    at Socket.<anonymous> (C:\Users\LALALA\ts3Events\serverCP.js:50:15)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at Socket.emit (C:\Users\LALALA\ts3Events\node_modules\socket.io\lib\socket.js:140:10)
    at Socket.onclose (C:\Users\LALALA\ts3Events\node_modules\socket.io\lib\socket.js:452:8)
 

DifferentUser

Member
Feb 19, 2016
53
23
58
You will need to send a keepalive, otherwise it will close the connection after 10 Minutes
Its already enough if you write a newline to the socket or a command, in your case you can send a command every x minutes

PHP:
var TeamSpeakClient = require("node-teamspeak")
var cl = new TeamSpeakClient("##SERVERIP###")

var interval = setInterval(() => cl.send("whoami"), 5* 60 * 1000)
cl.on("close", () => clearInterval(interval))
 

DifferentUser

Member
Feb 19, 2016
53
23
58
But the teamspeak-query library has many flaws, for example when a user connects with the nickname 0000 then you only receive the name 0 via query
Or if you request the clientlist and you are the only one connected you will receive an Object instead of a list
 

FromLondon

Honk Honk
TeamSpeak Developer
VIP
May 20, 2016
264
107
136
You will need to send a keepalive, otherwise it will close the connection after 10 Minutes
Its already enough if you write a newline to the socket or a command, in your case you can send a command every x minutes

PHP:
var TeamSpeakClient = require("node-teamspeak")
var cl = new TeamSpeakClient("##SERVERIP###")

var interval = setInterval(() => cl.send("whoami"), 5* 60 * 1000)
cl.on("close", () => clearInterval(interval))
Oh, man. I love you)
Many thanks, tonight I'll change the library!
 
Top