Previous: , Up: Services and Communication: Server and Client   [Contents]


B.8.2 STClient: Consuming a Service

Living mirror of a remote STServer. Prefer async start so discovery never freezes the main loop. Handshake: optional Authenticate, then snapshot (GetInputs/GetOutputs/ GetStats), then subscribe.

Function: STClient * st_client_new (void)

Creates an idle client.

Returns: New STClient.

Function: void st_client_set_notify_context (STClient *self, GMainContext *ctx)

Sets the context for all client GObject signals.

self

Client.

ctx

Affinity context, or NULL for default.

Returns: Nothing.

Function: GMainContext * st_client_get_notify_context (STClient *self)

Reads the notify context.

self

Client.

Returns: Borrowed GMainContext.

Function: void st_client_set_auth_token (STClient *self, const gchar *token)

Sets the shared secret used during handshake. Call before start. Empty/NULL means anonymous.

self

Client.

token

Shared secret, or NULL/empty.

Returns: Nothing.

See peer-auth-token.

Function: gchar * st_client_get_auth_token (const STClient *self)

Reads the configured token.

self

Client.

Returns: Newly allocated token (transfer full), or NULL.