Next: , Previous: , Up: STServer: Publishing a Service   [Contents]


B.8.1.2 Peers

Structure: STServerPeer

One connected client:

peer_id

Opaque peer identifier (guint).

info

Owned short description (credentials / tcp:…); free the struct with st_server_peer_free.

Function: guint st_server_get_n_peers (const STServer *self)

Counts currently connected peers.

self

Server.

Returns: Peer count.

Function: GPtrArray * st_server_dup_peers (const STServer *self)

Snapshots all peers.

self

Server.

Returns: New GPtrArray of STServerPeer * (free elements with st_server_peer_free, then unref the array).

Function: STServerPeer * st_server_dup_peer (const STServer *self, guint peer_id)

Snapshots one peer by id.

self

Server.

peer_id

Peer identifier.

Returns: New STServerPeer, or NULL if unknown; free with st_server_peer_free.

Function: void st_server_peer_free (STServerPeer *peer)

Frees a peer snapshot (including info).

peer

Peer to free; NULL-safe.

Returns: Nothing.