Connect a device
The business server first supplies a peer_id and connection token, then the device calls the TiRTC SDK.
See Issue connection parameters for the business-server flow and public token algorithm.
Call the SDK
int TiRtcWhipConnect(const char *service_desc,
const char *token,
TIRTCCONNECTCALLBACK cb,
void *user_data);Pass the complete peer_id as service_desc. Deliver the token only to the authorized device; it may be reused until expiry. The later DELETE <Location> request carries no token.
The TiRTC SDK and platform handle service discovery, regional routing, and per-request protection automatically.
Disconnect and reconnect
After a disconnect callback, call TiRtcWhipConnect again with the same peer_id and delegation token if the token is still valid. Obtain a new token only after expiry, revocation, or a scope change. A device cannot create tokens from a public key and must never store the customer's Ed25519 signing private key.
The WHIP Service must always reclaim resources on connection loss and must not assume that every device sends DELETE.