Managing server connection handlers

Before connecting to a TeamSpeak 3 server, a new server connection handler needs to be spawned. Each handler is identified by a unique ID (usually called serverConnectionHandlerID). With one server connection handler a connection can be established and dropped multiple times, so for simply reconnecting to the same or another server no new handler needs to be spawned but existing ones can be reused. However, for using multiple connections simultaneously a new handler has to be spawned for each connection.

To create a new server connection handler and receive its ID, call

unsigned int ts3client_spawnNewServerConnectionHandler(port,  
 result); 
int port;
uint64* result;
 

To destroy a server connection handler, call

unsigned int ts3client_destroyServerConnectionHandler(serverConnectionHandlerID); 
uint64 serverConnectionHandlerID;
 

Both functions return ERROR_ok on success, otherwise an error code as defined in public_errors.h.

[Important]Important

Destroying invalidates the handler ID, so it must not be used anymore afterwards. Also do not destroy a server connection handler ID from within a callback.