Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
sol_http_server_progressive_config Struct Reference

Progressive server response configuration. More...

#include <sol-http-server.h>

Data Fields

uint16_t api_version
 api_version must match SOL_HTTP_REQUEST_INTERFACE_API_VERSION at runtime. More...
 
size_t feed_size
 The output buffer size - 0 means unlimited data. More...
 
void(* on_close )(void *data, const struct sol_http_progressive_response *progressive)
 Callback used to inform that the client has closed the connection. More...
 
void(* on_feed_done )(void *data, struct sol_http_progressive_response *progressive, struct sol_blob *blob, int status)
 Callback used to inform that a struct sol_blob was sent. More...
 
const void * user_data
 

Detailed Description

Progressive server response configuration.

See Also
sol_http_server_send_progressive_response()
Note
HTTP server follows the Soletta stream design pattern, which can be found here: IO Streams
Examples:
/src/samples/http/server-sse.c.

Field Documentation

uint16_t sol_http_server_progressive_config::api_version

api_version must match SOL_HTTP_REQUEST_INTERFACE_API_VERSION at runtime.

Examples:
/src/samples/http/server-sse.c.

Referenced by request_events_cb().

size_t sol_http_server_progressive_config::feed_size

The output buffer size - 0 means unlimited data.

See Also
sol_http_progressive_response_feed() The feed buffer max size. The value 0 means unlimited data. Since sol_http_progressive_response_feed() works with blobs, no extra buffers will be allocated in order to store feed_size bytes. All the blobs that are schedule to be written will be referenced and the sum of all queued blobs must not be equal or exceed feed_size. If it happens sol_http_progressive_response_feed() will return -ENOSPC and one must start to control the writing flow until on_feed_done is called.
sol_http_progressive_response_feed()
void(* sol_http_server_progressive_config::on_close)(void *data, const struct sol_http_progressive_response *progressive)

Callback used to inform that the client has closed the connection.

Parameters
dataThe user data
progressiveThe progressive response
void(* sol_http_server_progressive_config::on_feed_done)(void *data, struct sol_http_progressive_response *progressive, struct sol_blob *blob, int status)

Callback used to inform that a struct sol_blob was sent.

Parameters
dataThe user data
progressiveThe progressive response
blobThe blob that was transferred
Note
The blob will unref for you automatically
It's safe to call sol_http_progressive_response_del() inside this callback.
const void* sol_http_server_progressive_config::user_data

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