class

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)
Source
new(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)
Source

Instance methods

close
Source
connected?
Source
disconnect
Source
message_loop(messages = @messages)
Source
on_message
Source
on_message=(blk : Proc(ReceivedMessage, Nil) | Nil)
Source
ping
Source
puback(packet_id : UInt16)
Source
publish(topic : String, body, qos : Int = 0_u8, retain = false, dup = false)
Source
publish(msg : Message)
Source
pubrec(packet_id : UInt16)
Source
send_publish(socket : IO, topic : String, body : Slice, qos : UInt8, retain : Bool, dup : Bool) : UInt16 | Nil
Source
subscribe(topic : String, qos : Int = 0_u8)
Source
subscribe(*topics : Tuple(String, Int))
Source
unsubscribe(*topics : String)
Source