module

MQTT

Constants

DEFAULT_MAX_PACKET_SIZE = (8_u32 * 1024) * 1024

Default limit on the size of a single packet we're willing to buffer from a remote host. Without a limit a hostile or faulty broker can advertise a MAX_REMAINING_LENGTH sized packet and force us to buffer 256MB of data.

DEFAULT_PORT = 1883

Default port number for unencrypted connections

DEFAULT_SSL_PORT = 8883

Default port number for TLS/SSL encrypted connections

Log = ::Log.for(self)
MAX_REMAINING_LENGTH = 268435455_u32

The largest remaining-length the 4 byte variable length header can encode

Class methods

generate_client_id(prefix = "crystal")
Source
monotonic
Source
peek_type(io : IO)
Source
topic_matches?(filter : String, topic : String) : Bool

Does a topic name match a subscription filter?

The wildcard rules are unchanged between 3.1.1 and 5.0, so both clients share this. Based on https://github.com/ralphtheninja/mqtt-match

Source

Macros

string(name, onlyif = nil, default = nil, &block)
Source

Nested types