feat: flush after write
This commit is contained in:
parent
ecebc72d3b
commit
49b7fdb832
10
mqtt.lua
10
mqtt.lua
|
@ -142,6 +142,11 @@ function MqttClient:connect (username, password)
|
|||
return err
|
||||
end
|
||||
|
||||
local _, err = self.conn:flush()
|
||||
if err ~= nil then
|
||||
return err
|
||||
end
|
||||
|
||||
self.is_connecting = true
|
||||
|
||||
return nil
|
||||
|
@ -163,6 +168,11 @@ function MqttClient:disconnect (reason)
|
|||
return err
|
||||
end
|
||||
|
||||
local _, err = self.conn:flush()
|
||||
if err ~= nil then
|
||||
return err
|
||||
end
|
||||
|
||||
self.is_connecting = false
|
||||
self.is_connected = false
|
||||
|
||||
|
|
Loading…
Reference in New Issue