MqttConnector.Adaptor(opts)

new Adaptor(opts)

Parameters:
Name Type Description
opts object

Methods

publish()

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.