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

#include <DPLWebSocket.h>

Inherits o2::framework::HTTPParser.

Public Member Functions

 WSDPLHandler (uv_stream_t *stream, DriverServerContext *context)
 
virtual ~WSDPLHandler ()=default
 
void method (std::string_view const &s) override
 
void target (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 associated client.
 
void write (std::vector< uv_buf_t > &outputs)
 Helper to write n buffers containing websockets frames to a server.
 
void error (int code, char const *message)
 Helper to return an error.
 
- Public Member Functions inherited from o2::framework::HTTPParser
virtual void version (std::string_view const &s)
 
virtual void replyVersion (std::string_view const &s)
 
virtual void replyCode (std::string_view const &s)
 
virtual void replyMessage (std::string_view const &s)
 

Public Attributes

std::unique_ptr< WebSocketHandlermHandler
 
bool mHandshaken = false
 
uv_stream_t * mStream = nullptr
 
std::map< std::string, std::string > mHeaders
 
DriverServerContextmServerContext
 
- Public Attributes inherited from o2::framework::HTTPParser
std::string remaining
 
std::string error
 
std::vector< HTTPStatestates
 

Detailed Description

Definition at line 37 of file DPLWebSocket.h.

Constructor & Destructor Documentation

◆ WSDPLHandler()

o2::framework::WSDPLHandler::WSDPLHandler ( uv_stream_t *  stream,
DriverServerContext context 
)

A http parser suitable to be used by DPL as a server stream is the stream from which the data is read, context to use to register the Handler to the appropriate DeviceInfo. handler is the websocket handler to react on the various frames

Definition at line 181 of file DPLWebSocket.cxx.

◆ ~WSDPLHandler()

virtual o2::framework::WSDPLHandler::~WSDPLHandler ( )
virtualdefault

Member Function Documentation

◆ body()

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

Actual handling of WS frames happens inside here.

Reimplemented from o2::framework::HTTPParser.

Definition at line 320 of file DPLWebSocket.cxx.

◆ endHeaders()

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

Make sure this is a websocket upgrade request.

Create an appropriate reply

Reimplemented from o2::framework::HTTPParser.

Definition at line 258 of file DPLWebSocket.cxx.

◆ error()

void o2::framework::WSDPLHandler::error ( int  code,
char const *  message 
)

Helper to return an error.

Definition at line 376 of file DPLWebSocket.cxx.

◆ header()

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

Reimplemented from o2::framework::HTTPParser.

Definition at line 253 of file DPLWebSocket.cxx.

◆ method()

void o2::framework::WSDPLHandler::method ( std::string_view const &  s)
overridevirtual

Reimplemented from o2::framework::HTTPParser.

Definition at line 187 of file DPLWebSocket.cxx.

◆ target()

void o2::framework::WSDPLHandler::target ( std::string_view const &  s)
overridevirtual

Reimplemented from o2::framework::HTTPParser.

Definition at line 194 of file DPLWebSocket.cxx.

◆ write() [1/2]

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

Helper to write a message to the associated client.

Definition at line 355 of file DPLWebSocket.cxx.

◆ write() [2/2]

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

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

Definition at line 363 of file DPLWebSocket.cxx.

Member Data Documentation

◆ mHandler

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

Definition at line 61 of file DPLWebSocket.h.

◆ mHandshaken

bool o2::framework::WSDPLHandler::mHandshaken = false

Definition at line 62 of file DPLWebSocket.h.

◆ mHeaders

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

Definition at line 64 of file DPLWebSocket.h.

◆ mServerContext

DriverServerContext* o2::framework::WSDPLHandler::mServerContext

Definition at line 65 of file DPLWebSocket.h.

◆ mStream

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

Definition at line 63 of file DPLWebSocket.h.


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