class MQTT::Client::Connection

Defined in:

mqtt-client/connection.cr

Constant Summary

Log = ::Log.for(self)

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, on_message : Proc(ReceivedMessage, Nil) | Nil = nil) #

[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, on_message : Proc(ReceivedMessage, Nil) | Nil = nil) #

[View source]

Instance Method Detail

def close #

[View source]
def connected? : Bool #

[View source]
def disconnect #

[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 subscribe(topic : String, qos : UInt8 = 0_u8) #

[View source]
def subscribe(topics : Enumerable(Tuple(String, UInt8))) #

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

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

[View source]