Class IStreamChannelAbstract

The IStreamChannel class.

This class provides the stream channel methods that can be invoked by your app.

Hierarchy

  • IStreamChannel

Constructors

Methods

  • Return the channel name of this stream channel.

    Returns string

    The channel name.

  • Join a topic.

    Parameters

    Returns number

    • 0: Success.
    • < 0: Failure.
  • Leave the channel.

    Parameters

    • Optional requestId: number

    Returns number

    • 0: Success.
    • < 0: Failure.
  • Leave the topic.

    Parameters

    • topic: string
    • Optional requestId: number

    Returns number

    • 0: Success.
    • < 0: Failure.
  • Publish a message in the topic.

    Parameters

    Returns number

    • 0: Success.
    • < 0: Failure.
  • Parameters

    • topic: string
    • message: Uint8Array
    • length: number
    • option: PublishOptions

    Returns number

  • Release the stream channel instance.

    Returns number

    • 0: Success.
    • < 0: Failure.
  • Renews the token. Once a token is enabled and used, it expires after a certain period of time. You should generate a new token on your server, call this method to renew it.

    Parameters

    • token: string

    Returns number

  • Subscribe a topic.

    Parameters

    • topic: string
    • options: TopicOptions
    • Optional requestId: number

    Returns number

    • 0: Success.
    • < 0: Failure.