This project has moved. For the latest updates, please go here.

Use of QueryRunner.Notifications

Feb 9, 2012 at 3:10 PM
Edited Feb 9, 2012 at 3:27 PM

I'm having some problems getting Notifications to work. I can't find any reference to it being unfinished, but I found no examples either.n

I'm trying to get notified when a user joins my server. This is a slightly simplified code snippet:

queryRunner.Login(_userName, _password);

queryRunner.Notifications.ClientJoined += OnClientJoined;
queryRunner.Notifications.ClientMoved += OnClientMoved;

var defaultChannel = queryRunner.GetChannelList().First();
queryRunner.RegisterForNotifications(TS3QueryLib.Core.Query.HelperClasses.ServerNotifyRegisterEvent.Channel, defaultChannel.ChannelId);

After this I block the thread, waiting for something to happen. Neither of the two event handling methods are being called.
Am I doing something wrong? I also tried without the optional channel ID.

Feb 10, 2012 at 3:37 PM

You must use the AsyncTcpDispatcher (not SyncTcpDispatcher)
The synchronous tcp dispatcher does not support notifications.


When using the AsyncTcpDispatcher be aware, that there is an event "ReadyForSendingCommands" on the AsyncTcpDispatcher class. You need to attach to this event and only start fireing events against the query-runner when this event was first called.

May 12, 2014 at 10:29 AM
Edited May 12, 2014 at 10:41 AM
I ve got same problems using the asynctcpdispatcher. How do it work?
            AsyncDispatcher = New AsyncTcpDispatcher(server, port)
            AddHandler AsyncDispatcher.ReadyForSendingCommands, AddressOf readyForSendingCommands
        Catch ex As Exception

        End Try
    Private Sub readyForSendingCommands(sender As Object, e As EventArgs)
        tsQuery = New TS3QueryLib.Core.Server.QueryRunner(AsyncDispatcher)

    End Sub
Can you give me a simple example for getting a connection and listen for notification (messages or

May 19, 2014 at 9:16 AM
got it