C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::net::web_socket Namespace Reference

Contains an implementation for message exchange over the WebSocket protocol. More...

Classes

class  acceptor
 Accepts or rejects incoming connection requests. More...
 
class  client
 Implements the client part for the WebSocket Protocol as defined in RFC. More...
 
class  client_factory
 Factory for the with(...).connect(...).start(...) DSL. More...
 
class  frame
 An implicitly shared type for passing along WebSocket data frames, i.e., text or binary frames. More...
 
class  framing
 Implements the WebSocket framing protocol as defined in RFC-6455. More...
 
class  handshake
 Wraps state and algorithms for the WebSocket client handshake as defined in RFC 6455. More...
 
class  has_on_request
 DSL entry point for creating a server. More...
 
struct  is_acceptor
 Type trait that determines if a type is an acceptor. More...
 
struct  is_acceptor< acceptor< Ts... > >
 Specialization of is_acceptor for acceptor types. More...
 
class  lower_layer
 Produces text and binary messages for the upper layer. More...
 
class  server
 Implements the server part for the WebSocket Protocol as defined in RFC. More...
 
class  server_factory
 Factory type for the with(...).accept(...).start(...) DSL. More...
 
class  server_factory_base
 Factory type for the with(...).accept(...).start(...) DSL. More...
 
struct  switch_protocol_bind_1
 DSL entry point for creating a server. More...
 
struct  switch_protocol_bind_2
 Binds a switch_protocol invocation to a function object for on_request. More...
 
class  upper_layer
 Consumes text and binary messages from the lower layer. More...
 
class  with_t
 Entry point for the with(...) DSL. More...
 

Typedefs

template<class Acceptor >
using server_factory_t = typename server_factory_oracle<Acceptor>::type
 

Enumerations

enum class  status : uint16_t {
  normal_close = 1000 ,
  going_away = 1001 ,
  protocol_error = 1002 ,
  invalid_data = 1003 ,
  no_status = 1005 ,
  abnormal_exit = 1006 ,
  inconsistent_data = 1007 ,
  policy_violation = 1008 ,
  message_too_big = 1009 ,
  missing_extensions = 1010 ,
  unexpected_condition = 1011 ,
  tls_handshake_failure = 1015
}
 Status codes as defined by RFC 6455, Section 7.4. More...
 

Functions

auto switch_protocol ()
 
with_t with (actor_system &sys)
 
with_t with (multiplexer *mpx)
 

Variables

template<class T >
constexpr bool is_acceptor_v = is_acceptor<T>::value
 A constexpr bool variable that evaluates to true if the given type is an acceptor, false otherwise.
 

Detailed Description

Contains an implementation for message exchange over the WebSocket protocol.

Enumeration Type Documentation

◆ status

enum class caf::net::web_socket::status : uint16_t
strong

Status codes as defined by RFC 6455, Section 7.4.

Enumerator
normal_close 

Indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled.

going_away 

Indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page.

protocol_error 

Indicates that an endpoint is terminating the connection due to a protocol error.

invalid_data 

Indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).

no_status 

A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint.

It is designated for use in applications expecting a status code to indicate that no status code was actually present.

abnormal_exit 

A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint.

It is designated for use in applications expecting a status code to indicate that the connection was closed abnormally, e.g., without sending or receiving a Close control frame.

inconsistent_data 

Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message).

policy_violation 

Indicates that an endpoint is terminating the connection because it has received a message that violates its policy.

This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy.

message_too_big 

Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process.

missing_extensions 

Indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake.

The list of extensions that are needed SHOULD appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the WebSocket handshake instead.

unexpected_condition 

Indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.

tls_handshake_failure 

A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint.

It is designated for use in applications expecting a status code to indicate that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).