OpenClaw SDK
    Preparing search index...

    Class ConnectionStateMachine

    Connection state machine with valid transition enforcement.

    States:

    • disconnected: Initial state, no connection
    • connecting: TCP/TLS connection in progress
    • handshaking: Protocol handshake in progress
    • authenticating: Authentication in progress
    • ready: Fully connected and authenticated
    • reconnecting: Attempting to reconnect after disconnect
    • closed: Connection closed (terminal state)
    Index

    Constructors

    Methods

    • Set a callback for handling errors thrown by state change listeners.

      By default, listener errors are silently ignored to prevent one buggy listener from breaking the entire state machine flow. Use this method to customize error handling (e.g., logging to error tracking service).

      Parameters

      Returns void