Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MqttAdaptor

Hierarchy

  • MqttAdaptor

Index

Constructors

constructor

Properties

publishRoute

publishRoute: string

subReqs

subReqs: object

Type declaration

subscribeRoute

subscribeRoute: string

Methods

onPubAck

onPublish

onSubscribe

publish

  • publish(client: MQTTSocket, packet: object): void
  • Publish message or subscription ack.

    if packet.id exist and this.subReqs[packet.id] exist then packet is a suback. Subscription is request/response mode. packet.id is pass from client in packet.messageId and record in Pomelo context and attached to the subscribe response packet. packet.body is the context that returned by subscribe next callback.

    if packet.id not exist then packet is a publish message.

    otherwise packet is a illegal packet.

    Parameters

    • client: MQTTSocket
    • packet: object
      • body: any
      • id: number

    Returns void