Wire Sysio Wire Sysion 1.0.0
|
Processor for Hybi Draft version 00. More...
#include <hybi00.hpp>
Public Types | |
typedef processor< config > | base |
typedef config::request_type | request_type |
typedef config::response_type | response_type |
typedef config::message_type | message_type |
typedef message_type::ptr | message_ptr |
typedef config::con_msg_manager_type::ptr | msg_manager_ptr |
Public Types inherited from websocketpp::processor::processor< config > | |
typedef processor< config > | type |
typedef config::request_type | request_type |
typedef config::response_type | response_type |
typedef config::message_type::ptr | message_ptr |
typedef std::pair< lib::error_code, std::string > | err_str_pair |
Public Member Functions | |
hybi00 (bool secure, bool p_is_server, msg_manager_ptr manager) | |
int | get_version () const |
Get the protocol version of this processor. | |
lib::error_code | validate_handshake (request_type const &r) const |
validate a WebSocket handshake request for this version | |
lib::error_code | process_handshake (request_type const &req, std::string const &subprotocol, response_type &res) const |
Calculate the appropriate response for this websocket request. | |
lib::error_code | client_handshake_request (request_type &, uri_ptr, std::vector< std::string > const &) const |
Fill in a set of request headers for a client connection request. | |
lib::error_code | validate_server_handshake_response (request_type const &, response_type &) const |
Validate the server's response to an outgoing handshake request. | |
std::string | get_raw (response_type const &res) const |
Given a completed response, get the raw bytes to put on the wire. | |
std::string const & | get_origin (request_type const &r) const |
Return the value of the header containing the CORS origin. | |
lib::error_code | extract_subprotocols (request_type const &req, std::vector< std::string > &subprotocol_list) |
Extracts requested subprotocols from a handshake request. | |
uri_ptr | get_uri (request_type const &request) const |
Extracts client uri from a handshake request. | |
std::string | get_key3 () const |
Get hybi00 handshake key3. | |
size_t | consume (uint8_t *buf, size_t len, lib::error_code &ec) |
Process new websocket connection bytes. | |
bool | ready () const |
Checks if there is a message ready. | |
bool | get_error () const |
Tests whether the processor is in a fatal error state. | |
message_ptr | get_message () |
Retrieves the most recently processed message. | |
virtual lib::error_code | prepare_data_frame (message_ptr in, message_ptr out) |
Prepare a message for writing. | |
lib::error_code | prepare_ping (std::string const &, message_ptr) const |
Prepare a ping frame. | |
lib::error_code | prepare_pong (std::string const &, message_ptr) const |
Prepare a pong frame. | |
lib::error_code | prepare_close (close::status::value, std::string const &, message_ptr out) const |
Prepare a close frame. | |
Public Member Functions inherited from websocketpp::processor::processor< config > | |
processor (bool secure, bool p_is_server) | |
virtual | ~processor () |
size_t | get_max_message_size () const |
Get maximum message size. | |
void | set_max_message_size (size_t new_value) |
Set maximum message size. | |
virtual bool | has_permessage_compress () const |
Returns whether or not the permessage_compress extension is implemented. | |
virtual err_str_pair | negotiate_extensions (request_type const &) |
Initializes extensions based on the Sec-WebSocket-Extensions header. | |
virtual err_str_pair | negotiate_extensions (response_type const &) |
Initializes extensions based on the Sec-WebSocket-Extensions header. | |
virtual size_t | get_bytes_needed () const |
virtual lib::error_code | prepare_data_frame (message_ptr in, message_ptr out)=0 |
Prepare a data message for writing. | |
virtual lib::error_code | prepare_ping (std::string const &in, message_ptr out) const =0 |
Prepare a ping frame. | |
virtual lib::error_code | prepare_pong (std::string const &in, message_ptr out) const =0 |
Prepare a pong frame. | |
virtual lib::error_code | prepare_close (close::status::value code, std::string const &reason, message_ptr out) const =0 |
Prepare a close frame. | |
Additional Inherited Members | |
Protected Attributes inherited from websocketpp::processor::processor< config > | |
bool const | m_secure |
bool const | m_server |
size_t | m_max_message_size |
There are many differences between Hybi 00 and Hybi 13
Definition at line 54 of file hybi00.hpp.
processor<config> websocketpp::processor::hybi00< config >::base |
Definition at line 56 of file hybi00.hpp.
message_type::ptr websocketpp::processor::hybi00< config >::message_ptr |
Definition at line 62 of file hybi00.hpp.
config::message_type websocketpp::processor::hybi00< config >::message_type |
Definition at line 61 of file hybi00.hpp.
config::con_msg_manager_type::ptr websocketpp::processor::hybi00< config >::msg_manager_ptr |
Definition at line 64 of file hybi00.hpp.
config::request_type websocketpp::processor::hybi00< config >::request_type |
Definition at line 58 of file hybi00.hpp.
config::response_type websocketpp::processor::hybi00< config >::response_type |
Definition at line 59 of file hybi00.hpp.
|
inlineexplicit |
Definition at line 66 of file hybi00.hpp.
|
inlinevirtual |
The Hybi 00 processor only implements incoming connections so this will always return an error.
[out] | req | Set of headers to fill in |
[in] | uri | The uri being connected to |
[in] | subprotocols | The list of subprotocols to request |
Implements websocketpp::processor::processor< config >.
Definition at line 158 of file hybi00.hpp.
|
inlinevirtual |
Implements websocketpp::processor::processor< config >.
Definition at line 252 of file hybi00.hpp.
|
inlinevirtual |
hybi00 does support subprotocols https://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00#section-1.9
[in] | req | The request to extract from |
[out] | subprotocol_list | A reference to a vector of strings to store the results in. |
Implements websocketpp::processor::processor< config >.
Definition at line 198 of file hybi00.hpp.
|
inlinevirtual |
Implements websocketpp::processor::processor< config >.
Definition at line 313 of file hybi00.hpp.
|
inline |
Definition at line 247 of file hybi00.hpp.
|
inlinevirtual |
Retrieves a shared pointer to the recently completed message if there is one. If ready() returns true then there is a message available. Retrieving the message with get_message will reset the state of ready. As such, each new message may be retrieved only once. Calling get_message when there is no message available will result in a null pointer being returned.
Implements websocketpp::processor::processor< config >.
Definition at line 317 of file hybi00.hpp.
|
inlinevirtual |
Implements websocketpp::processor::processor< config >.
Definition at line 185 of file hybi00.hpp.
|
inlinevirtual |
Implements websocketpp::processor::processor< config >.
Definition at line 179 of file hybi00.hpp.
|
inlinevirtual |
Implements websocketpp::processor::processor< config >.
Definition at line 217 of file hybi00.hpp.
|
inlinevirtual |
Implements websocketpp::processor::processor< config >.
Definition at line 73 of file hybi00.hpp.
|
inline |
Hybi 00 doesn't support the close code or reason so these parameters are ignored.
code | The close code to send |
reason | The reason string to send |
out | The message buffer to prepare the fame in |
Definition at line 401 of file hybi00.hpp.
|
inlinevirtual |
Performs validation, masking, compression, etc. will return an error if there was an error, otherwise msg will be ready to be written
Definition at line 329 of file hybi00.hpp.
|
inline |
Hybi 00 doesn't support pings so this will always return an error
in | The string to use for the ping payload |
out | The message buffer to prepare the ping in. |
Definition at line 373 of file hybi00.hpp.
|
inline |
Hybi 00 doesn't support pongs so this will always return an error
in | The string to use for the pong payload |
out | The message buffer to prepare the pong in. |
Definition at line 386 of file hybi00.hpp.
|
inlinevirtual |
req | The request to process |
subprotocol | The subprotocol in use |
res | The response to store the processed response in |
Implements websocketpp::processor::processor< config >.
Definition at line 100 of file hybi00.hpp.
|
inlinevirtual |
Checks if the most recent consume operation processed enough bytes to complete a new WebSocket message. The message can be retrieved by calling get_message() which will reset the internal state to not-ready and allow consume to read more bytes.
Implements websocketpp::processor::processor< config >.
Definition at line 309 of file hybi00.hpp.
|
inlinevirtual |
request | The WebSocket handshake request to validate. is_websocket_handshake(request) must be true and get_websocket_version(request) must equal this->get_version(). |
Implements websocketpp::processor::processor< config >.
Definition at line 77 of file hybi00.hpp.
|
inlinevirtual |
The Hybi 00 processor only implements incoming connections so this will always return an error.
req | The original request sent |
res | The reponse to generate |
Implements websocketpp::processor::processor< config >.
Definition at line 173 of file hybi00.hpp.