Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
HttpServer Class Reference
Inheritance diagram for HttpServer:
TcpServer TcpConnection

Public Member Functions

void enableHeaderProcessing (String headerName)
 
bool isHeaderProcessingEnabled (String name)
 
void addPath (String path, HttpPathDelegate callback)
 
void setDefaultHandler (HttpPathDelegate callback)
 
void enableWebSockets (bool enabled)
 Web Sockets.
 
void commandProcessing (bool enabled, String reqReqestParam)
 
__forceinline WebSocketsList & getActiveWebSockets ()
 
void setWebSocketConnectionHandler (WebSocketDelegate handler)
 
void setWebSocketMessageHandler (WebSocketMessageDelegate handler)
 
void setWebSocketBinaryHandler (WebSocketBinaryDelegate handler)
 
void setWebSocketDisconnectionHandler (WebSocketDelegate handler)
 
- Public Member Functions inherited from TcpServer
 TcpServer (TcpClientConnectDelegate onClientHandler, TcpClientDataDelegate clientReceiveDataHandler, TcpClientCompleteDelegate clientCompleteHandler)
 
 TcpServer (TcpClientDataDelegate clientReceiveDataHandler, TcpClientCompleteDelegate clientCompleteHandler)
 
 TcpServer (TcpClientDataDelegate clientReceiveDataHandler)
 
virtual bool listen (int port)
 
void setTimeOut (uint16_t waitTimeOut)
 
- Public Member Functions inherited from TcpConnection
 TcpConnection (bool autoDestruct)
 
 TcpConnection (tcp_pcb *connection, bool autoDestruct)
 
virtual bool connect (String server, int port)
 
virtual bool connect (IPAddress addr, uint16_t port)
 
virtual void close ()
 
int writeString (const char *data, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
 
int writeString (const String data, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
 
virtual int write (const char *data, int len, uint8_t apiflags=TCP_WRITE_FLAG_COPY)
 
int write (IDataSourceStream *stream)
 
__forceinline uint16_t getAvailableWriteSize ()
 
void flush ()
 
void setTimeOut (uint16_t waitTimeOut)
 
IPAddress getRemoteIp ()
 
uint16_t getRemotePort ()
 

Protected Member Functions

virtual TcpConnectioncreateClient (tcp_pcb *clientTcp)
 
virtual bool initWebSocket (HttpServerConnection &connection, HttpRequest &request, HttpResponse &response)
 
virtual bool processRequest (HttpServerConnection &connection, HttpRequest &request, HttpResponse &response)
 
virtual void processWebSocketFrame (pbuf *buf, HttpServerConnection &connection)
 
WebSocketgetWebSocket (HttpServerConnection &connection)
 
void removeWebSocket (HttpServerConnection &connection)
 
void onCloseWebSocket (HttpServerConnection &connection)
 
- Protected Member Functions inherited from TcpServer
virtual err_t onAccept (tcp_pcb *clientTcp, err_t err)
 
virtual void onClient (TcpClient *client)
 
virtual void onClientComplete (TcpClient &client, bool succesfull)
 
virtual bool onClientReceive (TcpClient &client, char *data, int size)
 
- Protected Member Functions inherited from TcpConnection
bool internalTcpConnect (IPAddress addr, uint16_t port)
 
virtual err_t onConnected (err_t err)
 
virtual err_t onReceive (pbuf *buf)
 
virtual err_t onSent (uint16_t len)
 
virtual err_t onPoll ()
 
virtual void onError (err_t err)
 
virtual void onReadyToSendData (TcpConnectionEvent sourceEvent)
 
void initialize (tcp_pcb *pcb)
 

Friends

class HttpServerConnection
 

Additional Inherited Members

- Public Attributes inherited from TcpServer
uint16_t activeClients = 0
 
- Static Public Attributes inherited from TcpServer
static int16_t totalConnections
 
- Static Protected Member Functions inherited from TcpServer
static err_t staticAccept (void *arg, tcp_pcb *new_tcp, err_t err)
 
- Static Protected Member Functions inherited from TcpConnection
static err_t staticOnConnected (void *arg, tcp_pcb *tcp, err_t err)
 
static err_t staticOnReceive (void *arg, tcp_pcb *tcp, pbuf *p, err_t err)
 
static err_t staticOnSent (void *arg, tcp_pcb *tcp, uint16_t len)
 
static err_t staticOnPoll (void *arg, tcp_pcb *tcp)
 
static void staticOnError (void *arg, err_t err)
 
static void staticDnsResponse (const char *name, ip_addr_t *ipaddr, void *arg)
 
static void closeTcpConnection (tcp_pcb *tpcb)
 
- Protected Attributes inherited from TcpConnection
tcp_pcb * tcp
 
uint16_t sleep
 
uint16_t timeOut
 
bool canSend
 
bool autoSelfDestruct