Suggestions

close search

Signaling overview

Use the OpenTok signaling API to send text and data between clients connected to an OpenTok session.

These messages allow developers to build basic text chat, send instructions from one client to another, and create other valuable experiences.

The OpenTok client SDKs include methods for sending signals to clients connected to an OpenTok session. They also include events that are dispatched when a signal is received. For details, see the signaling developer guide for OpenTok.js, iOS, and Android.

Signal payloads

Each signal contains data and type values, both of which are strings:

A client can also send a signal with no data or type defined. This ping signal will only identify the sender of the signal.

The signal also includes a property that identifies the client that sent the signal.

You can send a signal to a specific client or to all clients connected to a session.

Signal delivery

For a client connected to an OpenTok Session, the OpenTok client SDK dispatches an event when the client receives a signal. However, there is no event on the sending client that indicates that the recipient(s) received a signal. If your application requires it, you can use the signaling API to send receipt acknowledgments back to the sending client.

The OpenTok server relays signals from the sending client to receiving clients. The signal is sent using TCP-based WebSocket connections between clients and the OpenTok server. Signal delivery is not strictly guaranteed, but signaling uses packet retransmission abilities inherent to TCP.

Signal event order is preserved for signals sent from a signal client, but not across all clients. For example, if client A sends signals 1 and 2 to all clients in a session, and client A sends signals 3 and 4 to all clients in a session. Signal 1 will be received before signal 2, and signal 3 will be received before signal 4. But there is no guarantee that client A's events will be received before client B's signal.

Signaling is available to all OpenTok clients. Signaling does not require the OpenTok Media Router) — it is available in all sessions (routed or relayed).