CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs::HTTPTestServer Class Reference

Minimal HTTP server used by the unit tests: replies with a canned page. More...

#include <NetworkManager.h>

Inheritance diagram for cmlabs::HTTPTestServer:
[legend]
Collaboration diagram for cmlabs::HTTPTestServer:
[legend]

Public Member Functions

 HTTPTestServer ()
 ~HTTPTestServer ()
virtual bool receiveHTTPRequest (HTTPRequest *req, NetworkChannel *channel, uint64 conid)
 Serve a test page for any request.
Public Member Functions inherited from cmlabs::NetworkReceiver
 NetworkReceiver ()
virtual bool receiveNetworkEvent (NetworkEvent *evt, NetworkChannel *channel, uint64 conid)
 A connection lifecycle event occurred.
virtual bool receiveMessage (DataMessage *msg, NetworkChannel *channel, uint64 conid)
 A binary DataMessage arrived.
virtual bool receiveTelnetLine (TelnetLine *line, NetworkChannel *channel, uint64 conid)
 A Telnet line arrived.
virtual bool receiveHTTPReply (HTTPReply *reply, HTTPRequest *req, NetworkChannel *channel, uint64 conid)
 An HTTP reply to an earlier async request arrived.
virtual bool receiveWebsocketData (WebsocketData *wsData, NetworkChannel *channel, uint64 conid)
 A WebSocket message arrived.

Detailed Description

Minimal HTTP server used by the unit tests: replies with a canned page.

Definition at line 112 of file NetworkManager.h.

Constructor & Destructor Documentation

◆ HTTPTestServer()

cmlabs::HTTPTestServer::HTTPTestServer ( )

Definition at line 2408 of file NetworkManager.cpp.

◆ ~HTTPTestServer()

cmlabs::HTTPTestServer::~HTTPTestServer ( )

Definition at line 2411 of file NetworkManager.cpp.

Member Function Documentation

◆ receiveHTTPRequest()

bool cmlabs::HTTPTestServer::receiveHTTPRequest ( HTTPRequest * req,
NetworkChannel * channel,
uint64 conid )
virtual

Serve a test page for any request.

Returns
true always.

Reimplemented from cmlabs::NetworkReceiver.

Definition at line 2414 of file NetworkManager.cpp.

References cmlabs::HTTPReply::createPage(), cmlabs::utils::GetLocalIPAddress(), cmlabs::GetTimeNow(), HTTP_OK, and cmlabs::NetworkChannel::sendHTTPReply().


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