MQTT::Client::Connection
Inherits Reference / Object
Constructors
new(host : String, port = 1883, tls = false, client_id = "", clean_session = true, user : String | Nil = nil, password : String | Nil = nil, will : Message | Nil = nil, keepalive : Int = 60_u16, autoack = true, sock_opts = SocketOptions.new)
Sourcenew(socket : IO, client_id : String = "", clean_session : Bool = true, user : String | Nil = nil, password : String | Nil = nil, will : Message | Nil = nil, keepalive : UInt16 = 60_u16, autoack : Bool = false)
SourceInstance methods
close
Sourceconnected?
Sourcedisconnect
Sourcemessage_loop(messages = @messages)
Sourceon_message
Sourceon_message=(blk : Proc(ReceivedMessage, Nil) | Nil)
Sourceping
Sourcepuback(packet_id : UInt16)
Sourcepublish(topic : String, body, qos : Int = 0_u8, retain = false, dup = false)
Sourcepublish(msg : Message)
Sourcepubrec(packet_id : UInt16)
Sourcesend_publish(socket : IO, topic : String, body : Slice, qos : UInt8, retain : Bool, dup : Bool) : UInt16 | Nil
Sourcesubscribe(topic : String, qos : Int = 0_u8)
Sourcesubscribe(*topics : Tuple(String, Int))
Sourceunsubscribe(*topics : String)
Source