|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Minimal WebSocket echo server used by the unit tests (handles upgrade + echo). More...
#include <NetworkManager.h>
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. | |
Minimal WebSocket echo server used by the unit tests (handles upgrade + echo).
Definition at line 122 of file NetworkManager.h.
| cmlabs::WebsocketTestServer::WebsocketTestServer | ( | ) |
Definition at line 2429 of file NetworkManager.cpp.
| cmlabs::WebsocketTestServer::~WebsocketTestServer | ( | ) |
Definition at line 2432 of file NetworkManager.cpp.
|
virtual |
Answer the WebSocket upgrade handshake.
Reimplemented from cmlabs::NetworkReceiver.
Definition at line 2435 of file NetworkManager.cpp.
|
virtual |
Echo received frames back to the client.
Reimplemented from cmlabs::NetworkReceiver.
Definition at line 2441 of file NetworkManager.cpp.
References cmlabs::WebsocketData::BINARY, cmlabs::WebsocketData::dataType, cmlabs::WebsocketData::getContent(), cmlabs::PrintTimeNowString(), cmlabs::NetworkChannel::sendWebsocketData(), cmlabs::WebsocketData::setData(), cmlabs::utils::StringFormat(), and cmlabs::WebsocketData::TEXT.