ESP32 HTTPS Server

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
httpsserver::HTTPConnection Class Reference

Represents a single open connection for the plain HTTPServer, without TLS. More...

`#include <HTTPConnection.hpp>`

Inheritance diagram for httpsserver::HTTPConnection:
[legend]
Collaboration diagram for httpsserver::HTTPConnection:
[legend]

## Public Member Functions
| HTTPConnection (ResourceResolver *resResolver)
virtual int | initialize (int serverSocketID, HTTPHeaders *defaultHeaders)
virtual void | closeConnection ()
virtual bool | isSecure ()
void | loop ()
bool | isClosed ()
bool | isError ()

## Protected Types
enum | { STATE_UNDEFINED, STATE_INITIAL, STATE_REQUEST_FINISHED, STATE_HEADERS_FINISHED, STATE_BODY_FINISHED, STATE_WEBSOCKET, STATE_CLOSING, STATE_CLOSED, STATE_ERROR }
enum | { CSTATE_UNDEFINED, CSTATE_ACTIVE, CSTATE_CLOSED }

## Protected Member Functions
virtual size_t | writeBuffer (byte *buffer, size_t length)
virtual size_t | readBytesToBuffer (byte *buffer, size_t length)
virtual bool | canReadData ()
virtual size_t | pendingByteCount ()

## Protected Attributes
unsigned long | _lastTransmissionTS
unsigned long | _shutdownTS
enum httpsserver::HTTPConnection:: { ... } | _connectionState
enum httpsserver::HTTPConnection:: { ... } | _clientState

## Friends
class | HTTPRequest
class | HTTPResponse
class | WebsocketInputStreambuf

## Detailed Description

Represents a single open connection for the plain HTTPServer, without TLS.

## Member Function Documentation

## ◆ initialize()

int httpsserver::HTTPConnection::initialize | ( | int | serverSocketID,
|  | HTTPHeaders * | defaultHeaders
| ) |  |
| virtual

Initializes the connection from a server socket.

The call WILL BLOCK if accept(serverSocketID) blocks. So use select() to check for that in advance.

## ◆ isClosed()

bool httpsserver::HTTPConnection::isClosed | ( |  | ) |

Returns true, if the connection has been closed.

## ◆ isError()

bool httpsserver::HTTPConnection::isError | ( |  | ) |

Returns true, if the connection has been closed due to error

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

- /home/frank/Projekte/esp32/https_server/esp32_https_server/src/HTTPConnection.hpp
- /home/frank/Projekte/esp32/https_server/esp32_https_server/src/HTTPConnection.cpp