class MqttCrystal::Client
- MqttCrystal::Client
- Reference
- Object
Defined in:
mqtt_crystal/client.crConstant Summary
-
DEFAULT_SOCKET_ARGS =
{family: Socket::Family::INET, type: Socket::Type::STREAM, protocol: Socket::Protocol::TCP, blocking: false}
Constructors
Instance Method Summary
- #close
- #connect : self
- #connect(&)
- #connected? : Bool
- #host : String
- #host=(host : String)
- #id : String
- #id=(id : String)
- #password : String?
- #password=(password : Nil | String)
- #port : UInt16
- #port=(port : UInt16)
- #publish(topic : String, payload : String, qos : UInt8 = 1_u8, retain : Bool = false)
- #receive : Tuple(String, String)
- #subscribe(topic : String) : self
- #subscribe(topics : Enumerable(String)) : self
- #subscribed?(topic)
- #username : String?
- #username=(username : Nil | String)
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)
#