How to create the connector object to fetch server configuration information.
Read time 1 minuteLast updated 20 hours ago
Use a connector object after initialization to fetch server configuration information necessary for your game to login and use Vivox. The connector object is usually only called once per application startup before the first sign in.To create the connector object, use the
vx_req_connector_create
request structure and the
vx_req_connector_create_create()
function. This is typically the first request issued after
vx_initialize3()
.
Note
There can only be one active connector object at a time.
When the Vivox SDK processes the
vx_req_connector_create
request, it contacts the Vivox network and downloads configuration information to the client that's relevant to your game's communications infrastructure. This is a one-time HTTP request. The configuration information is loaded into memory before the sign in operation.If the game's connection is lost, you don't need to issue
vx_req_connector_create
a second time because the information is already in memory. Simply proceed to re-sign in to the game.The connector object doesn't hold open any ports, use bandwidth, network resources, or CPU for heartbeats, and only requires a small amount of memory to hold the configuration.The following code displays an example creating the connector object:
To use the connector object effectively, it's important to understand that the connector object doesn't establish a persistent connection to the Vivox back end that needs to be maintained while using the service.
After the game receives the
vx_resp_connector_create
message, the game can then sign in to Vivox.
Disconnect the connector object
Disconnecting the connector object unloads the configuration file from memory. You can disconnect the object by using the
vx_req_connector_initiate_shutdown
request.
Note
It's never necessary to call
vx_req_connector_initiate_shutdown
unless you intend to change which Vivox back end you connect to after the initial connection.