RESTinio
Loading...
Searching...
No Matches
ws_connection_base.hpp
Go to the documentation of this file.
1/*
2 restinio
3*/
4
5/*!
6 A base class for connection handle.
7*/
8
9#pragma once
10
11#include <memory>
12
13#include <restinio/tcp_connection_ctx_base.hpp>
14#include <restinio/common_types.hpp>
15#include <restinio/buffers.hpp>
16
17namespace restinio
18{
19
20namespace websocket
21{
22
23namespace basic
24{
25
26class ws_t;
27using ws_handle_t = std::shared_ptr< ws_t >;
28
29namespace impl
30{
31
32//
33// ws_connection_base_t
34//
35
36//! WebSocket connection base.
39{
40 public:
44
45 //! Shutdown websocket.
46 virtual void
47 shutdown() = 0;
48
49 //! Kill websocket.
50 virtual void
51 kill() = 0;
52
53 //! Start reading ws-messages.
54 virtual void
56
57 //! Write pieces of outgoing data.
58 virtual void
61 bool is_close_frame ) = 0;
62};
63
64//! Alias for WebSocket connection handle.
66
67} /* namespace impl */
68
69} /* namespace basic */
70
71} /* namespace websocket */
72
73} /* namespace restinio */
virtual void shutdown()=0
Shutdown websocket.
virtual void init_read(ws_handle_t wsh)=0
Start reading ws-messages.
virtual void write_data(write_group_t wg, bool is_close_frame)=0
Write pieces of outgoing data.
Group of writable items transported to the context of underlying connection as one solid piece.
Definition buffers.hpp:727
std::shared_ptr< ws_connection_base_t > ws_connection_handle_t
Alias for WebSocket connection handle.
std::shared_ptr< ws_t > ws_handle_t
Alias for ws_t handle.
std::uint64_t connection_id_t
Type for ID of connection.