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