NetworkWebSocketClientConnectionInterface Class Reference

#include <network_websocket.h>

Inheritance diagram for NetworkWebSocketClientConnectionInterface:

Public Member Functions

MAXON_METHOD Result< DataDictionary > OpenConnection (const String &address, const String &protocols, const CString &extraHeaderData, const ThreadRef &thread)
 

Private Member Functions

 MAXON_INTERFACE (NetworkWebSocketClientConnectionInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.networkwebsocketclientconnection")
 
- Private Member Functions inherited from NetworkWebSocketSignalInterface
 MAXON_OBSERVABLE (Result< String >, ObservableHandshake,(const NetworkWebSocketConnectionRef &webSocket, const DataDictionary &request), ObservableCombinerRunAllComponent)
 
 MAXON_OBSERVABLE (Result< void >, ObservableConnected,(const NetworkWebSocketConnectionRef &webSocket, const DataDictionary &request), ObservableCombinerRunAllComponent)
 
 MAXON_OBSERVABLE (void, ObservableDisconnected,(const NetworkWebSocketConnectionRef &webSocket), ObservableCombinerRunAllComponent)
 
 MAXON_OBSERVABLE (void, ObservableError,(const NetworkWebSocketConnectionRef &webSocket, const Error &err), ObservableCombinerRunAllComponent)
 
 MAXON_OBSERVABLE (Result< void >, ObservableMessage,(const NetworkWebSocketConnectionRef &webSocket, WEBSOCKET_OPCODE opCode, const BaseArray< Char > &data), ObservableCombinerRunAllComponent)
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( NetworkWebSocketClientConnectionInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.networkwebsocketclientconnection"   
)
private

◆ OpenConnection()

MAXON_METHOD Result<DataDictionary> OpenConnection ( const String address,
const String protocols,
const CString extraHeaderData,
const ThreadRef thread 
)

Start a client WebSocket connection to the given address e.g. "127.0.0.1:1234".

Parameters
[in]addressAddress of the server to connect.
[in]protocolsComma separated list of needed protocols e.g. "chat, superchat". The server picks on of the protocols for the communication.
[in]extraHeaderDataAdd extra data to the handshake header. A entry needs to be terminated by "\r\n". e.g. "id: data\r\nid2: data2\r\n"
[in]threadThread reference that is checked for IsCancelled().
Returns
Returns the http answer of the handshake.