RESTinio
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 
17 namespace restinio
18 {
19 
20 namespace websocket
21 {
22 
23 namespace basic
24 {
25 
26 class ws_t;
28 
29 namespace impl
30 {
31 
32 //
33 // ws_connection_base_t
34 //
35 
36 //! WebSocket connection base.
39 {
40  public:
41  ws_connection_base_t( connection_id_t id )
43  {}
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
55  init_read( ws_handle_t wsh ) = 0;
56 
57  //! Write pieces of outgoing data.
58  virtual void
59  write_data(
60  write_group_t wg,
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 write_data(write_group_t wg, bool is_close_frame)=0
Write pieces of outgoing data.
virtual void init_read(ws_handle_t wsh)=0
Start reading ws-messages.
virtual void shutdown()=0
Shutdown websocket.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type opt_value(const Parameter_Container &params, string_view_t key)
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists ...
Definition: value_or.hpp:64