RESTinio

ws_connection_base.hpp
Go to the documentation of this file.
1/*
2 restinio
3*/
4
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
17 namespace restinio
18{
19
20 namespace websocket
21{
22
23 namespace basic
24{
25
26 class ws_t;
27 using ws_handle_t = std::shared_ptr< ws_t >;
28
29 namespace impl
30{
31
32//
33// ws_connection_base_t
34//
35
37 class ws_connection_base_t
38 : public tcp_connection_ctx_base_t
39{
40 public:
41 ws_connection_base_t( connection_id_t id )
42 : tcp_connection_ctx_base_t{ id }
43 {}
44
46 virtual void
47 shutdown() = 0;
48
50 virtual void
51 kill() = 0;
52
54 virtual void
55 init_read( ws_handle_t wsh ) = 0;
56
58 virtual void
59 write_data(
60 write_group_t wg,
61 bool is_close_frame ) = 0;
62};
63
65 using ws_connection_handle_t = std::shared_ptr< ws_connection_base_t >;
66
67} /* namespace impl */
68
69} /* namespace basic */
70
71} /* namespace websocket */
72
73} /* namespace restinio */
buffers.hpp
restinio::tcp_connection_ctx_base_t
TCP connection base.
Definition: tcp_connection_ctx_base.hpp:29
restinio::websocket::basic::impl::ws_connection_base_t
WebSocket connection base.
Definition: ws_connection_base.hpp:39
restinio::websocket::basic::impl::ws_connection_base_t::shutdown
virtual void shutdown()=0
Shutdown websocket.
restinio::websocket::basic::impl::ws_connection_base_t::init_read
virtual void init_read(ws_handle_t wsh)=0
Start reading ws-messages.
restinio::websocket::basic::impl::ws_connection_base_t::ws_connection_base_t
ws_connection_base_t(connection_id_t id)
Definition: ws_connection_base.hpp:41
restinio::websocket::basic::impl::ws_connection_base_t::kill
virtual void kill()=0
Kill websocket.
restinio::websocket::basic::impl::ws_connection_base_t::write_data
virtual void write_data(write_group_t wg, bool is_close_frame)=0
Write pieces of outgoing data.
restinio::write_group_t
Group of writable items transported to the context of underlying connection as one solid piece.
Definition: buffers.hpp:692
common_types.hpp
restinio::websocket::basic::impl::ws_connection_handle_t
std::shared_ptr< ws_connection_base_t > ws_connection_handle_t
Alias for WebSocket connection handle.
Definition: ws_connection_base.hpp:65
restinio::websocket::basic::ws_handle_t
std::shared_ptr< ws_t > ws_handle_t
Alias for ws_t handle.
Definition: ws_connection_base.hpp:27
restinio
Definition: asio_include.hpp:21
restinio::connection_id_t
std::uint64_t connection_id_t
Type for ID of connection.
Definition: common_types.hpp:174
tcp_connection_ctx_base.hpp