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

Minimal WebSocket echo server used by the unit tests (handles upgrade + echo). More...

#include <NetworkManager.h>

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

Public Member Functions

 WebsocketTestServer ()
 ~WebsocketTestServer ()
virtual bool receiveHTTPRequest (HTTPRequest *req, NetworkChannel *channel, uint64 conid)
 Answer the WebSocket upgrade handshake.
virtual bool receiveWebsocketData (WebsocketData *wsData, NetworkChannel *channel, uint64 conid)
 Echo received frames back to the client.
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.

Detailed Description

Minimal WebSocket echo server used by the unit tests (handles upgrade + echo).

Definition at line 122 of file NetworkManager.h.

Constructor & Destructor Documentation

◆ WebsocketTestServer()

cmlabs::WebsocketTestServer::WebsocketTestServer ( )

Definition at line 2429 of file NetworkManager.cpp.

◆ ~WebsocketTestServer()

cmlabs::WebsocketTestServer::~WebsocketTestServer ( )

Definition at line 2432 of file NetworkManager.cpp.

Member Function Documentation

◆ receiveHTTPRequest()

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

Answer the WebSocket upgrade handshake.

Returns
true when upgraded.

Reimplemented from cmlabs::NetworkReceiver.

Definition at line 2435 of file NetworkManager.cpp.

◆ receiveWebsocketData()

bool cmlabs::WebsocketTestServer::receiveWebsocketData ( WebsocketData * wsData,
NetworkChannel * channel,
uint64 conid )
virtual

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