class MqttCrystal::Client

Defined in:

mqtt_crystal/client.cr

Constant Summary

DEFAULT_SOCKET_ARGS = {family: Socket::Family::INET, type: Socket::Type::STREAM, protocol: Socket::Protocol::TCP, blocking: false}

Constructors

Instance Method Summary

Constructor Detail

def self.new(host : String = "127.0.0.1", port : UInt16 = 1883_u16, username : String | Nil = nil, password : String | Nil = nil, url : String | Nil = nil, id : String | Nil = nil, keep_alive : UInt16 = 15_u16, auto_reconnect : Bool = true, tls : Bool = false) #

[View source]

Instance Method Detail

def close #

[View source]
def connect : self #

[View source]
def connect(&) #

[View source]
def connected? : Bool #

[View source]
def host : String #

[View source]
def host=(host : String) #

[View source]
def id : String #

[View source]
def id=(id : String) #

[View source]
def password : String? #

[View source]
def password=(password : Nil | String) #

[View source]
def port : UInt16 #

[View source]
def port=(port : UInt16) #

[View source]
def publish(topic : String, payload : String, qos : UInt8 = 1_u8, retain : Bool = false) #

[View source]
def receive : Tuple(String, String) #

[View source]
def subscribe(topic : String) : self #

[View source]
def subscribe(topics : Enumerable(String)) : self #

[View source]
def subscribed?(topic) #

[View source]
def username : String? #

[View source]
def username=(username : Nil | String) #

[View source]