PeerState

Represents the lifecycle state of a peer connection.

Values

CONNECTING

Connection attempt in progress.

CONNECTED

Peer is connected and data can flow.

DISCONNECTED

Peer is disconnected (intentional or network-related).

BLOCKED

Peer was blocked due to policy, auth, or abuse protection.

Usage

if (peer.state == PeerState.CONNECTED) {
    // safe to send messages
}