class MQTT::Client::Connection

Defined in:

mqtt-client/connection.cr

Constructors

Instance Method Summary

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) #

[View source]
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) #

[View source]

Instance Method Detail

def close #

[View source]
def connected? : Bool #

[View source]
def disconnect #

[View source]
def message_loop(messages = @messages) #

[View source]
def on_message(&blk : Proc(ReceivedMessage, Nil)) #

[View source]
def on_message=(blk : Proc(ReceivedMessage, Nil) | Nil) #

[View source]
def ping #

[View source]
def puback(packet_id : UInt16) #

[View source]
def publish(topic : String, body, qos : Int = 0_u8, retain = false, dup = false) #

[View source]
def publish(msg : Message) #

[View source]
def pubrec(packet_id : UInt16) #

[View source]
def send_publish(socket : IO, topic : String, body : Slice, qos : UInt8, retain : Bool, dup : Bool) : UInt16 | Nil #

[View source]
def subscribe(topic : String, qos : Int = 0_u8) #

[View source]
def subscribe(*topics : Tuple(String, Int)) #

[View source]
def unsubscribe(*topics : String) #

[View source]