template<typename Connection, typename FileSystem, typename WebSocketServer = void>
static_http::connection class

Class for http connections.

Constructors, destructors, conversion operators

template<typename Server>
connection(Server& _server)

Public functions

auto receive(uint8_t* src, uint8_t* src_end) -> bool

Function documentation

template<typenameConnection, typenameFileSystem, typenameWebSocketServer> template<typename Server>
static_http::connection<Connection, FileSystem, WebSocketServer>::connection(Server& _server)

Constructor for http connections.

template<typenameConnection, typenameFileSystem, typenameWebSocketServer>
bool static_http::connection<Connection, FileSystem, WebSocketServer>::receive(uint8_t* src, uint8_t* src_end)

Method to be called for incoming data received on this HTTP connection. Returns false if the data was invalid in which case the connection must be closed.

If a WebSocket connection has been accepted, false will be called, too. The TCP connection has in this case been reused to create a WebSocket connection and it is safe to call close() on this HTTP connection.