tinyhttp
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tinyhttp::HttpStreamedMultiOutput Class Reference

Generic HttpStreamedMultiOutput Class which handles multicast streaming. We can optionally define some default (e.g. html) content that will be written at the beginning and at the end of the streaming session to the client. More...

#include <HttpStreamedMultiOutput.h>

Inheritance diagram for tinyhttp::HttpStreamedMultiOutput:
tinyhttp::HttpStreamedOutput

Public Member Functions

 HttpStreamedMultiOutput (const char *mime, const char *startHtml=nullptr, const char *endHtml=nullptr, int maxHistoryLength=0)
 
virtual int availableForWrite ()
 Do not accept any writes if we are not connected.
 
virtual void close ()
 
virtual void doLoop ()
 
virtual bool isOpen ()
 
virtual bool isValid (WiFiClient &client)
 
virtual const char * mime ()
 
virtual void open (WiFiClient &client)
 
virtual size_t print (const char *str)
 
virtual size_t println (const char *str)
 
virtual size_t write (uint8_t *content, int len)
 

Protected Member Functions

void addHistory (const char *line, bool delimiter, int len)
 adds the line to the history - removest oldest lines
 
void cleanup ()
 
void onClose (WiFiClient &client)
 content that is written when the request is opened
 

Protected Attributes

List< WiFiClientclients
 
const char * end = nullptr
 
StrExthistory = nullptr
 
int id_value = 0
 
int max_history_length
 
const char * mime_type = nullptr
 
const char * start = nullptr
 
HttpChunkWriter writer
 

Detailed Description

Generic HttpStreamedMultiOutput Class which handles multicast streaming. We can optionally define some default (e.g. html) content that will be written at the beginning and at the end of the streaming session to the client.

The output (write, print ...) functions are sending the same output to all open clients.

The id is used to identify the output stream so that we can potentially send different content to different clients.

We automatically manage all the clients which are open and clean up the closed clients to release the memory.


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