class
MQTT::Transport::Websocket
- MQTT::Transport::Websocket
- MQTT::Transport
- Reference
- Object
Defined in:
mqtt/transport/websocket.crConstructors
-
.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.
Instance Method Summary
- #close! : Nil
- #closed? : Bool
- #host : String
- #path : String
- #send(message) : Nil
-
#start : Nil
Begins consuming data from the remote host.
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
Instance Method Detail
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