![]() |
Project
|
#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 () |
![]() | |
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< DriverClientContext > | mContext |
std::unique_ptr< WebSocketHandler > | mHandler |
uv_stream_t * | mStream = nullptr |
std::map< std::string, std::string > | mHeaders |
![]() | |
std::string | remaining |
std::string | error |
std::vector< HTTPState > | states |
Definition at line 68 of file DPLWebSocket.h.
o2::framework::WSDPLClient::WSDPLClient | ( | ) |
Definition at line 426 of file DPLWebSocket.cxx.
Actual handling of WS frames happens inside here.
Reimplemented from o2::framework::HTTPParser.
Definition at line 551 of file DPLWebSocket.cxx.
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.
void o2::framework::WSDPLClient::dumpHeaders | ( | ) |
Dump headers.
Definition at line 471 of file DPLWebSocket.cxx.
|
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.
|
overridevirtual |
Reimplemented from o2::framework::HTTPParser.
Definition at line 466 of file DPLWebSocket.cxx.
|
inline |
Definition at line 94 of file DPLWebSocket.h.
|
overridevirtual |
Reimplemented from o2::framework::HTTPParser.
Definition at line 459 of file DPLWebSocket.cxx.
|
overridevirtual |
Reimplemented from o2::framework::HTTPParser.
Definition at line 452 of file DPLWebSocket.cxx.
void o2::framework::WSDPLClient::sendHandshake | ( | ) |
Definition at line 441 of file DPLWebSocket.cxx.
Helper to write a message to the server.
Helper to return an error.
Definition at line 557 of file DPLWebSocket.cxx.
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.
std::unique_ptr<DriverClientContext> o2::framework::WSDPLClient::mContext |
Definition at line 99 of file DPLWebSocket.h.
std::unique_ptr<WebSocketHandler> o2::framework::WSDPLClient::mHandler |
Definition at line 100 of file DPLWebSocket.h.
std::function<void()> o2::framework::WSDPLClient::mHandshake |
Definition at line 98 of file DPLWebSocket.h.
std::atomic<bool> o2::framework::WSDPLClient::mHandshaken = false |
Definition at line 97 of file DPLWebSocket.h.
std::map<std::string, std::string> o2::framework::WSDPLClient::mHeaders |
Definition at line 102 of file DPLWebSocket.h.
std::string o2::framework::WSDPLClient::mNonce |
Definition at line 96 of file DPLWebSocket.h.
uv_stream_t* o2::framework::WSDPLClient::mStream = nullptr |
Definition at line 101 of file DPLWebSocket.h.