class MQTT::Client::Connection
- MQTT::Client::Connection
- Reference
- Object
Defined in:
mqtt-client/connection.crConstructors
- .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)
- .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)
Instance Method Summary
- #close
- #connected? : Bool
- #disconnect
- #message_loop(messages = @messages)
- #on_message(&blk : Proc(ReceivedMessage, Nil))
- #on_message=(blk : Proc(ReceivedMessage, Nil) | Nil)
- #ping
- #puback(packet_id : UInt16)
- #publish(topic : String, body, qos : Int = 0_u8, retain = false, dup = false)
- #publish(msg : Message)
- #pubrec(packet_id : UInt16)
- #send_publish(socket : IO, topic : String, body : Slice, qos : UInt8, retain : Bool, dup : Bool) : UInt16 | Nil
- #subscribe(topic : String, qos : Int = 0_u8)
- #subscribe(*topics : Tuple(String, Int))
- #unsubscribe(*topics : String)
Constructor Detail
def self.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)
#
def self.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)
#
Instance Method Detail
def send_publish(socket : IO, topic : String, body : Slice, qos : UInt8, retain : Bool, dup : Bool) : UInt16 | Nil
#