Project
Loading...
Searching...
No Matches
o2::framework::WSDPLClient Struct Reference

#include <DPLWebSocket.h>

Inherits o2::framework::HTTPParser.

Public Member Functions

 WSDPLClient ()
 
void connect (ServiceRegistryRef ref, uv_stream_t *stream, std::function< void()> handshake, std::unique_ptr< WebSocketHandler > handler)
 
void replyVersion (std::string_view const &s) override
 
void replyCode (std::string_view const &s) override
 
void header (std::string_view const &k, std::string_view const &v) override
 
void endHeaders () override
 
void body (char *data, size_t s) override
 Actual handling of WS frames happens inside here.
 
void write (char const *, size_t)
 Helper to write a message to the server.
 
void write (std::vector< uv_buf_t > &outputs)
 Helper to write n buffers containing websockets frames to a server.
 
void dumpHeaders ()
 Dump headers.
 
void sendHandshake ()
 
bool isHandshaken ()
 
- Public Member Functions inherited from o2::framework::HTTPParser
virtual void method (std::string_view const &s)
 
virtual void target (std::string_view const &s)
 
virtual void version (std::string_view const &s)
 
virtual void replyMessage (std::string_view const &s)
 

Public Attributes

std::string mNonce
 
std::atomic< bool > mHandshaken = false
 
std::function< void()> mHandshake
 
std::unique_ptr< DriverClientContextmContext
 
std::unique_ptr< WebSocketHandlermHandler
 
uv_stream_t * mStream = nullptr
 
std::map< std::string, std::string > mHeaders
 
- Public Attributes inherited from o2::framework::HTTPParser
std::string remaining
 
std::string error
 
std::vector< HTTPStatestates
 

Detailed Description

Definition at line 68 of file DPLWebSocket.h.

Constructor & Destructor Documentation

◆ WSDPLClient()

o2::framework::WSDPLClient::WSDPLClient ( )

Definition at line 426 of file DPLWebSocket.cxx.

Member Function Documentation

◆ body()

void o2::framework::WSDPLClient::body ( char data,
size_t  s 
)
overridevirtual

Actual handling of WS frames happens inside here.

Reimplemented from o2::framework::HTTPParser.

Definition at line 551 of file DPLWebSocket.cxx.

◆ connect()

void o2::framework::WSDPLClient::connect ( ServiceRegistryRef  ref,
uv_stream_t *  stream,
std::function< void()>  handshake,
std::unique_ptr< WebSocketHandler handler 
)

stream where the communication happens and spec of the device connecting to the driver. spec the DeviceSpec associated with this client handshake a callback to invoke whenever we have a successful handshake

Definition at line 431 of file DPLWebSocket.cxx.

◆ dumpHeaders()

void o2::framework::WSDPLClient::dumpHeaders ( )

Dump headers.

Definition at line 471 of file DPLWebSocket.cxx.

◆ endHeaders()

void o2::framework::WSDPLClient::endHeaders ( )
overridevirtual

Make sure this is a websocket upgrade request.

Create an appropriate reply

Reimplemented from o2::framework::HTTPParser.

Definition at line 478 of file DPLWebSocket.cxx.

◆ header()

void o2::framework::WSDPLClient::header ( std::string_view const &  k,
std::string_view const &  v 
)
overridevirtual

Reimplemented from o2::framework::HTTPParser.

Definition at line 466 of file DPLWebSocket.cxx.

◆ isHandshaken()

bool o2::framework::WSDPLClient::isHandshaken ( )
inline

Definition at line 94 of file DPLWebSocket.h.

◆ replyCode()

void o2::framework::WSDPLClient::replyCode ( std::string_view const &  s)
overridevirtual

Reimplemented from o2::framework::HTTPParser.

Definition at line 459 of file DPLWebSocket.cxx.

◆ replyVersion()

void o2::framework::WSDPLClient::replyVersion ( std::string_view const &  s)
overridevirtual

Reimplemented from o2::framework::HTTPParser.

Definition at line 452 of file DPLWebSocket.cxx.

◆ sendHandshake()

void o2::framework::WSDPLClient::sendHandshake ( )

Definition at line 441 of file DPLWebSocket.cxx.

◆ write() [1/2]

void o2::framework::WSDPLClient::write ( char const *  message,
size_t  s 
)

Helper to write a message to the server.

Helper to return an error.

Definition at line 557 of file DPLWebSocket.cxx.

◆ write() [2/2]

void o2::framework::WSDPLClient::write ( std::vector< uv_buf_t > &  outputs)

Helper to write n buffers containing websockets frames to a server.

Definition at line 566 of file DPLWebSocket.cxx.

Member Data Documentation

◆ mContext

std::unique_ptr<DriverClientContext> o2::framework::WSDPLClient::mContext

Definition at line 99 of file DPLWebSocket.h.

◆ mHandler

std::unique_ptr<WebSocketHandler> o2::framework::WSDPLClient::mHandler

Definition at line 100 of file DPLWebSocket.h.

◆ mHandshake

std::function<void()> o2::framework::WSDPLClient::mHandshake

Definition at line 98 of file DPLWebSocket.h.

◆ mHandshaken

std::atomic<bool> o2::framework::WSDPLClient::mHandshaken = false

Definition at line 97 of file DPLWebSocket.h.

◆ mHeaders

std::map<std::string, std::string> o2::framework::WSDPLClient::mHeaders

Definition at line 102 of file DPLWebSocket.h.

◆ mNonce

std::string o2::framework::WSDPLClient::mNonce

Definition at line 96 of file DPLWebSocket.h.

◆ mStream

uv_stream_t* o2::framework::WSDPLClient::mStream = nullptr

Definition at line 101 of file DPLWebSocket.h.


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