Forum

Results 1 to 2 of 2
  1. #1
    Join Date
    July 2019
    Posts
    1

    Event subscription fails after time

    I am writing bot application with node js and plugin 'node-teamspeak-api'.
    I want to track connections of clients to some channel, and if client belongs to one of selected groups, to move it to another channel.
    So I do
    login id pw
    use (number of server)
    and then servernotifyregister looks like

    Code:
    function subscribeForChannelSwitch() {
        return new Promise(function(resolve, reject) {
            params = {
                event : 'channel',
                id : 0 // 0 id means that we listen on all channels
            };
            defines.tsClient.send('servernotifyregister', params, function(err, resp){
                if (err) {
                    reject({
                        description : 'Error during \'servernotifyregister\' command.',
                        data : err
                    });
                } else {
                    resolve({
                        description : 'Command \'servernotifyregister\' done for event \'channel\' with id ' + params.id + '.',
                        data : resp
                    });
                }
            });
        });
    }
    and listener function is

    Code:
    defines.tsClient.on('notify', function(eventName, resp) {
            includes.logger.info('Event notification on \'notify\':\n', eventName, resp, '\n');
            processEvents(eventName, resp);
        });
    For a while (10-60 minutes) all looks oky, and events are received, but then, without any error message or anything, events are omitted, and not coming anymore.

    Why? Is there any way to avoid this? Is the issue with the code or with plugin or with server settings? From putty I am getting notifications, but connection is closed after some.
    Also would be good to see any documentation in english about events, because this very important article seems to be only in german.

  2. #2
    Join Date
    April 2014
    Posts
    38
    Your socket might disconnect after a time aswell the library by default wont send a command every 5 minutes
    if you dont send data to the socket within 5 minutes the socket will disconnect you from the server

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How do I cancel my TS subscription?
    By Dumphole in forum General Questions
    Replies: 3
    Last Post: March 5th, 2018, 12:47 AM
  2. [Not Supported] Client fails to connect for 1st time, but 2nd works.
    By tipakA in forum Off Topic
    Replies: 1
    Last Post: October 16th, 2017, 11:18 AM
  3. subscription issues...
    By bigredusa1 in forum Bug Reports [EN/DE]
    Replies: 4
    Last Post: May 21st, 2011, 10:59 PM
  4. [Resolved] subscription issues...
    By bigredusa1 in forum Permission System
    Replies: 4
    Last Post: May 21st, 2011, 10:59 PM
  5. Channel subscription
    By Pierobon in forum Client Support
    Replies: 1
    Last Post: April 23rd, 2010, 02:22 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •