class CoAP::Client

Defined in:

coap/client.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(host : String, port = nil, tls : TLSContext = nil) #

[View source]
def self.new(uri : URI, tls : TLSContext = nil) #

[View source]

Instance Method Detail

def before_request(&callback : CoAP::Request -> ) #

[View source]
def before_transmit(&callback : CoAP::Message -> ) #

[View source]
def check_for_timeouts #

[View source]
def close : Nil #

[View source]
def closed? #

[View source]
def exec(request : CoAP::Request) : CoAP::ResponseHandler | Nil #

TODO : allow this to handle multiple requests at once, including observes requires channels for each message_id and a fiber for response processing


[View source]
def exec!(request : CoAP::Request) : CoAP::ResponseHandler #

[View source]
def finalize #

[View source]
def host : String #

[View source]
def io=(transport : IO) #

[View source]
def port : Int32 #

[View source]
def process_message(message : CoAP::Message) #

[View source]
def read_timeout : Float64 #

default CoAP timeout


[View source]
def read_timeout=(read_timeout : Number) #

Sets the number of seconds to wait when reading before raising an IO::TimeoutError.


[View source]
def read_timeout=(read_timeout : Time::Span) #

Sets the read timeout with a Time::Span, to wait when reading before raising an IO::TimeoutError.


[View source]
def tls : OpenSSL::SSL::Context::Client #

[View source]
def tls? : OpenSSL::SSL::Context::Client | Nil #

[View source]