C# Class TeamSpeak3QueryApi.Net.QueryClient

Represents a client that can be used to access the TeamSpeak Query API on a remote server.
Inheritance: IDisposable
Show file Open project: nikeee/TeamSpeak3QueryAPI

Public Properties

Property Type Description
DefaultHost string
DefaultPort short

Public Methods

Method Description
Connect ( ) : System.Threading.Tasks.Task

Connects to the Query API server.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

QueryClient ( ) : System

Creates a new instance of TeamSpeak3QueryApi.Net.QueryClient using the QueryClient.DefaultHost and QueryClient.DefaultPort.

QueryClient ( string hostName ) : System

Creates a new instance of TeamSpeak3QueryApi.Net.QueryClient using the provided host and the QueryClient.DefaultPort.

QueryClient ( string hostName, short port ) : System

Creates a new instance of TeamSpeak3QueryApi.Net.QueryClient using the provided host TCP port.

Send ( string cmd ) : Task

Sends a Query API command wihtout parameters to the server.

Send ( string cmd, Parameter parameters, string options ) : Task

Sends a Query API command with parameters and options to the server.

Subscribe ( string notificationName, Action callback ) : void

Subscribes to a notification. If the subscribed notification is received, the callback is getting executed.

Unsubscribe ( string notificationName ) : void

Unsubscribes all callbacks of a notification.

Unsubscribe ( string notificationName, Action callback ) : void

Unsubscribe a callback of a notification.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Private Methods

Method Description
CheckQueue ( ) : System.Threading.Tasks.Task
InvokeNotification ( QueryNotification notification ) : void
InvokeResponse ( QueryCommand forCommand ) : void
NormalizeNotificationName ( string name ) : string
ParseError ( string errorString ) : QueryError
ParseNotification ( string notificationString ) : QueryNotification
ParseResponse ( string rawResponse ) : QueryResponseDictionary[]
ResponseProcessingLoop ( ) : void

Method Details

Connect() public method

Connects to the Query API server.
public Connect ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
protected Dispose ( bool disposing ) : void
disposing bool A value indicating whether the object is disposing or finalizing.
return void

QueryClient() public method

Creates a new instance of TeamSpeak3QueryApi.Net.QueryClient using the QueryClient.DefaultHost and QueryClient.DefaultPort.
public QueryClient ( ) : System
return System

QueryClient() public method

Creates a new instance of TeamSpeak3QueryApi.Net.QueryClient using the provided host and the QueryClient.DefaultPort.
public QueryClient ( string hostName ) : System
hostName string The host name of the remote server.
return System

QueryClient() public method

Creates a new instance of TeamSpeak3QueryApi.Net.QueryClient using the provided host TCP port.
public QueryClient ( string hostName, short port ) : System
hostName string The host name of the remote server.
port short The TCP port of the Query API server.
return System

Send() public method

Sends a Query API command wihtout parameters to the server.
public Send ( string cmd ) : Task
cmd string The command.
return Task

Send() public method

Sends a Query API command with parameters and options to the server.
public Send ( string cmd, Parameter parameters, string options ) : Task
cmd string The command.
parameters Parameter The parameters of the command.
options string The options of the command.
return Task

Subscribe() public method

Subscribes to a notification. If the subscribed notification is received, the callback is getting executed.
public Subscribe ( string notificationName, Action callback ) : void
notificationName string The name of the notification (without the "notify" prefix).
callback Action The callback to execute on occurrence.
return void

Unsubscribe() public method

Unsubscribes all callbacks of a notification.
public Unsubscribe ( string notificationName ) : void
notificationName string The name of the notification to unsubscribe (without the "notify" prefix).
return void

Unsubscribe() public method

Unsubscribe a callback of a notification.
public Unsubscribe ( string notificationName, Action callback ) : void
notificationName string The name of the notification to unsubscribe (without the "notify" prefix).
callback Action The callback to unsubscribe.
return void

Property Details

DefaultHost public static property

The default host which is used when no host is provided.
public static string DefaultHost
return string

DefaultPort public static property

The default port which is used when no port is provided.
public static short DefaultPort
return short