class

MqttCrystal::Client

Inherits Reference / Object

Constants

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

Constructors

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

Instance methods

close
Source
connect
Source
connect
Source
connected?
Source
host
Source
host=(host : String)
Source
id=(id : String)
Source
password
Source
password=(password : Nil | String)
Source
port
Source
port=(port : UInt16)
Source
publish(topic : String, payload : String, qos : UInt8 = 1_u8, retain : Bool = false)
Source
receive
Source
subscribe(topic : String) : self
Source
subscribe(topics : Enumerable(String)) : self
Source
subscribed?(topic)
Source
username
Source
username=(username : Nil | String)
Source