class MQTT::Transport::Websocket

Defined in:

mqtt/transport/websocket.cr

Constructors

Instance Method Summary

Instance methods inherited from class MQTT::Transport

close! : Nil close!, closed? : Bool closed?, error : Exception | Nil error, on_close(&on_close : -> ) on_close, on_message(&on_message : Bytes -> ) : Nil on_message, on_tokenize(&on_tokenize : IO::Memory -> Int32) on_tokenize, send(message) : Nil send, start : Nil start

Constructor methods inherited from class MQTT::Transport

new new

Constructor Detail

def self.new(host : String, path : String, port : Int32 | Nil = nil, tls : HTTP::Client::TLSContext = nil, headers : HTTP::Headers = HTTP::Headers.new) #

NOTE : the socket is not opened here. Connecting is deferred to #start, which the client calls once it is ready to consume data


[View source]

Instance Method Detail

def close! : Nil #

[View source]
def closed? : Bool #

[View source]
def host : String #

[View source]
def path : String #

[View source]
def send(message) : Nil #

[View source]
def start : Nil #
Description copied from class MQTT::Transport

Begins consuming data from the remote host. Called by the client once its callbacks have been configured so that no data can arrive before there is something able to process it


[View source]