Interface MqttClientConnectionEvents


  • public interface MqttClientConnectionEvents
    Interface used to receive connection events from the CRT
    • Method Detail

      • onConnectionInterrupted

        void onConnectionInterrupted​(int errorCode)
        Called when the connection was lost (or disconnected), reconnect will be attempted automatically until disconnect() is called
        Parameters:
        errorCode - AWS CRT error code, pass to CRT.awsErrorString(int) for a human readable error
      • onConnectionResumed

        void onConnectionResumed​(boolean sessionPresent)
        Called whenever a reconnect succeeds; not called on an initial connect success
        Parameters:
        sessionPresent - true if the session has been resumed, false if the session is clean
      • onConnectionSuccess

        default void onConnectionSuccess​(OnConnectionSuccessReturn data)
        Called on every successful connect and every successful reconnect. Optional and is not required to be defined.
        Parameters:
        data - The data sent from the client alongside the successful connection callback.
      • onConnectionFailure

        default void onConnectionFailure​(OnConnectionFailureReturn data)
        Called on every unsuccessful connect and every unsuccessful disconnect. Optional and is not required to be defined.
        Parameters:
        data - The data sent from the client alongside the failed connection callback.
      • onConnectionClosed

        default void onConnectionClosed​(OnConnectionClosedReturn data)
        Called when the connection was disconnected and shutdown successfully. Optional and is not required to be defined.
        Parameters:
        data - The data sent from the client alongside the successful disconnect.