Seastar
High performance C++ framework for concurrent servers
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Classes | Enumerations | Enumerator | Functions | Variables
WebSocket

Detailed Description

Classes

class  seastar::experimental::websocket::exception
 an error in handling a WebSocket connection More...
 
struct  seastar::experimental::websocket::frame_header
 
class  seastar::experimental::websocket::websocket_parser
 
class  seastar::experimental::websocket::connection
 a WebSocket connection More...
 
class  seastar::experimental::websocket::server
 a WebSocket server More...
 

Enumerations

enum  seastar::experimental::websocket::opcodes {
  CONTINUATION = 0x0 , TEXT = 0x1 , BINARY = 0x2 , CLOSE = 0x8 ,
  PING = 0x9 , PONG = 0xA , INVALID = 0xFF
}
 Possible type of a websocket frame.
 

Functions

 seastar::experimental::websocket::exception::exception (std::string_view msg)
 
virtual const char * seastar::experimental::websocket::exception::what () const noexcept
 
 seastar::experimental::websocket::frame_header::frame_header (const char *input)
 
uint64_t seastar::experimental::websocket::frame_header::get_rest_of_header_length ()
 
uint8_t seastar::experimental::websocket::frame_header::get_fin ()
 
uint8_t seastar::experimental::websocket::frame_header::get_rsv1 ()
 
uint8_t seastar::experimental::websocket::frame_header::get_rsv2 ()
 
uint8_t seastar::experimental::websocket::frame_header::get_rsv3 ()
 
uint8_t seastar::experimental::websocket::frame_header::get_opcode ()
 
uint8_t seastar::experimental::websocket::frame_header::get_masked ()
 
uint8_t seastar::experimental::websocket::frame_header::get_length ()
 
bool seastar::experimental::websocket::frame_header::is_opcode_known ()
 
future< consumption_result_tseastar::experimental::websocket::websocket_parser::operator() (temporary_buffer< char > data)
 
bool seastar::experimental::websocket::websocket_parser::is_valid ()
 
bool seastar::experimental::websocket::websocket_parser::eof ()
 
opcodes seastar::experimental::websocket::websocket_parser::opcode () const
 
buff_t seastar::experimental::websocket::websocket_parser::result ()
 
 seastar::experimental::websocket::connection::connection_source_impl::connection_source_impl (queue< buff_t > *data)
 
virtual future< buff_tseastar::experimental::websocket::connection::connection_source_impl::get () override
 
virtual future seastar::experimental::websocket::connection::connection_source_impl::close () override
 
 seastar::experimental::websocket::connection::connection_sink_impl::connection_sink_impl (queue< buff_t > *data)
 
virtual future seastar::experimental::websocket::connection::connection_sink_impl::put (net::packet d) override
 
size_t seastar::experimental::websocket::connection::connection_sink_impl::buffer_size () const noexcept override
 
virtual future seastar::experimental::websocket::connection::connection_sink_impl::close () override
 
 seastar::experimental::websocket::connection::connection (server &server, connected_socket &&fd)
 
future seastar::experimental::websocket::connection::process ()
 serve WebSocket protocol on a connection
 
void seastar::experimental::websocket::connection::shutdown_input ()
 close the socket
 
future seastar::experimental::websocket::connection::close (bool send_close=true)
 
future seastar::experimental::websocket::connection::read_loop ()
 
future seastar::experimental::websocket::connection::read_one ()
 
future seastar::experimental::websocket::connection::read_http_upgrade_request ()
 
future seastar::experimental::websocket::connection::response_loop ()
 
void seastar::experimental::websocket::connection::on_new_connection ()
 
future seastar::experimental::websocket::connection::send_data (opcodes opcode, temporary_buffer< char > &&buff)
 Packs buff in websocket frame and sends it to the client.
 
void seastar::experimental::websocket::server::listen (socket_address addr)
 listen for a WebSocket connection on given address More...
 
void seastar::experimental::websocket::server::listen (socket_address addr, listen_options lo)
 listen for a WebSocket connection on given address with custom options More...
 
future seastar::experimental::websocket::server::stop ()
 
bool seastar::experimental::websocket::server::is_handler_registered (std::string const &name)
 
void seastar::experimental::websocket::server::register_handler (std::string &&name, handler_t handler)
 
void seastar::experimental::websocket::server::accept (server_socket &listener)
 
future< stop_iterationseastar::experimental::websocket::server::accept_one (server_socket &listener)
 

Variables

static constexpr uint8_t seastar::experimental::websocket::frame_header::FIN = 7
 
static constexpr uint8_t seastar::experimental::websocket::frame_header::RSV1 = 6
 
static constexpr uint8_t seastar::experimental::websocket::frame_header::RSV2 = 5
 
static constexpr uint8_t seastar::experimental::websocket::frame_header::RSV3 = 4
 
static constexpr uint8_t seastar::experimental::websocket::frame_header::MASKED = 7
 
uint8_t seastar::experimental::websocket::frame_header::fin: 1
 
uint8_t seastar::experimental::websocket::frame_header::rsv1: 1
 
uint8_t seastar::experimental::websocket::frame_header::rsv2: 1
 
uint8_t seastar::experimental::websocket::frame_header::rsv3: 1
 
uint8_t seastar::experimental::websocket::frame_header::opcode: 4
 
uint8_t seastar::experimental::websocket::frame_header::masked: 1
 
uint8_t seastar::experimental::websocket::frame_header::length: 7
 

Function Documentation

◆ connection()

seastar::experimental::websocket::connection::connection ( server server,
connected_socket &&  fd 
)
inline
Parameters
serverowning server
fdestablished socket used for communication

◆ listen() [1/2]

void seastar::experimental::websocket::server::listen ( socket_address  addr)

listen for a WebSocket connection on given address

Parameters
addraddress to listen on

◆ listen() [2/2]

void seastar::experimental::websocket::server::listen ( socket_address  addr,
listen_options  lo 
)

listen for a WebSocket connection on given address with custom options

Parameters
addraddress to listen on
locustom listen options (listen_options)

◆ stop()

future seastar::experimental::websocket::server::stop ( )

Stops the server and shuts down all active connections