gcoap_listener Struct Reference

A modular collection of resources for a server. More...

Detailed Description

A modular collection of resources for a server.

Definition at line 752 of file gcoap.h.

#include <gcoap.h>

Data Fields

const coap_resource_tresources
 First element in the array of resources; must order alphabetically.
 
size_t resources_len
 Length of array.
 
gcoap_socket_type_t tl_type
 Transport type for the listener. More...
 
gcoap_link_encoder_t link_encoder
 Writes a link for a resource.
 
struct gcoap_listenernext
 Next listener in list.
 
gcoap_request_matcher_t request_matcher
 Function that picks a suitable request handler from a request. More...
 

Field Documentation

◆ request_matcher

gcoap_request_matcher_t gcoap_listener::request_matcher

Function that picks a suitable request handler from a request.

Note
Leaving this NULL selects the default strategy that picks handlers by matching their Uri-Path to resource paths (as per the documentation of the resources and resources_len fields). Alternative handlers may cast the resources and resources_len fields to fit their needs.

Definition at line 779 of file gcoap.h.

◆ tl_type

gcoap_socket_type_t gcoap_listener::tl_type

Transport type for the listener.

Any transport supported by the implementation can be set as a flag. If GCOAP_SOCKET_TYPE_UNDEF is set, the listener listens on all supported transports. If non of the transports beyond UDP are compiled in (i.e. no usage of modules gcoap_dtls, ...) this will be ignored and GCOAP_SOCKET_TYPE_UDP assumed.

Definition at line 765 of file gcoap.h.


The documentation for this struct was generated from the following file: