Skip to content

Commit 2cfc08b

Browse files
mek-xdeadprogram
authored andcommitted
net/mqtt: add support for retained messsages
1 parent 1850c5e commit 2cfc08b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/mqtt/mqtt.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ func (c *mqttclient) Publish(topic string, qos byte, retained bool, payload inte
146146
pub := packets.NewControlPacket(packets.Publish).(*packets.PublishPacket)
147147
pub.Qos = qos
148148
pub.TopicName = topic
149+
pub.Retain = retained
149150
switch payload.(type) {
150151
case string:
151152
pub.Payload = []byte(payload.(string))

0 commit comments

Comments
 (0)