#include <network_websocket.h>
Class that handles the WebSocket Protocol and an easy interface to use WebSockets.
Public Types | |
using | RESTRICT_DICTIONARY_PROPS = NETWORKWEBSOCKETCONNECTIONPROPERTIES::RESTRICT |
Public Member Functions | |
MAXON_METHOD Result< void > | Init (const NetworkHttpHandlerRef &handler) |
MAXON_METHOD const NetworkHttpHandlerRef & | GetHandler () const |
MAXON_METHOD Result< void > | Close () |
MAXON_METHOD Result< void > | Send (const Block< const Char > &buffer, WEBSOCKETTYPE type) |
MAXON_METHOD Result< void > | Send (const String &data, WEBSOCKETTYPE type=WEBSOCKETTYPE::TEXT) |
MAXON_METHOD WEBSOCKETSTATE | GetState () const |
Private Member Functions | |
MAXON_INTERFACE (NetworkWebSocketConnectionInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.networkwebsocketconnection") | |
using RESTRICT_DICTIONARY_PROPS = NETWORKWEBSOCKETCONNECTIONPROPERTIES::RESTRICT |
|
private |
MAXON_METHOD Result<void> Init | ( | const NetworkHttpHandlerRef & | handler | ) |
MAXON_METHOD const NetworkHttpHandlerRef& GetHandler | ( | ) | const |
MAXON_METHOD Result<void> Close | ( | ) |
Closes the WebSocket connection.
MAXON_METHOD Result<void> Send | ( | const Block< const Char > & | buffer, |
WEBSOCKETTYPE | type | ||
) |
Send bytes as WebProtocol message.
[in] | buffer | Buffer data to send. |
[in] | type | Defines the type of the WebSocket frame to be send. |
MAXON_METHOD Result<void> Send | ( | const String & | data, |
WEBSOCKETTYPE | type = WEBSOCKETTYPE::TEXT |
||
) |
MAXON_METHOD WEBSOCKETSTATE GetState | ( | ) | const |
Returns the state of the connection.