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 write (std::vector< uv_buf_t > &outputs, std::vector< char * > &freeList)
 
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 69 of file DPLWebSocket.h.

Constructor & Destructor Documentation

◆ WSDPLClient()

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

Definition at line 434 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 563 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 439 of file DPLWebSocket.cxx.

◆ dumpHeaders()

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

Dump headers.

Definition at line 479 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 486 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 474 of file DPLWebSocket.cxx.

◆ isHandshaken()

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

Definition at line 99 of file DPLWebSocket.h.

◆ replyCode()

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

Reimplemented from o2::framework::HTTPParser.

Definition at line 467 of file DPLWebSocket.cxx.

◆ replyVersion()

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

Reimplemented from o2::framework::HTTPParser.

Definition at line 460 of file DPLWebSocket.cxx.

◆ sendHandshake()

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

Definition at line 449 of file DPLWebSocket.cxx.

◆ write() [1/3]

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 569 of file DPLWebSocket.cxx.

◆ write() [2/3]

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 578 of file DPLWebSocket.cxx.

◆ write() [3/3]

void o2::framework::WSDPLClient::write ( std::vector< uv_buf_t > &  outputs,
std::vector< char * > &  freeList 
)

Like write() above but recycles the chunk memory into freeList once the kernel has consumed the buffers, instead of freeing it.

Definition at line 591 of file DPLWebSocket.cxx.

Member Data Documentation

◆ mContext

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

Definition at line 104 of file DPLWebSocket.h.

◆ mHandler

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

Definition at line 105 of file DPLWebSocket.h.

◆ mHandshake

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

Definition at line 103 of file DPLWebSocket.h.

◆ mHandshaken

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

Definition at line 102 of file DPLWebSocket.h.

◆ mHeaders

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

Definition at line 107 of file DPLWebSocket.h.

◆ mNonce

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

Definition at line 101 of file DPLWebSocket.h.

◆ mStream

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

Definition at line 106 of file DPLWebSocket.h.


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