ESP32 HTTPS Server
ConnectionContext.hpp
1 #ifndef SRC_CONNECTIONCONTEXT_HPP_
2 #define SRC_CONNECTIONCONTEXT_HPP_
3 
4 #include <Arduino.h>
5 
6 // Required for SSL
7 #include "openssl/ssl.h"
8 #undef read
9 
10 namespace httpsserver {
11 
12 class WebsocketHandler;
13 
18 public:
20  virtual ~ConnectionContext();
21 
22  virtual void signalRequestError() = 0;
23  virtual void signalClientClose() = 0;
24  virtual size_t getCacheSize() = 0;
25 
26  virtual size_t readBuffer(byte* buffer, size_t length) = 0;
27  virtual size_t pendingBufferSize() = 0;
28 
29  virtual size_t writeBuffer(byte* buffer, size_t length) = 0;
30 
31  virtual bool isSecure() = 0;
32  virtual void setWebsocketHandler(WebsocketHandler *wsHandler);
33 
34  WebsocketHandler * _wsHandler;
35 };
36 
37 } /* namespace httpsserver */
38 
39 #endif /* SRC_CONNECTIONCONTEXT_HPP_ */
Definition: WebsocketHandler.hpp:34
Internal class to handle the state of a connection.
Definition: ConnectionContext.hpp:17
Definition: ConnectionContext.cpp:3