ws_connection_base.hpp
Go to the documentation of this file.
/*
restinio
*/
#pragma once
#include <memory>
#include <restinio/tcp_connection_ctx_base.hpp>
#include <restinio/common_types.hpp>
#include <restinio/buffers.hpp>
namespace restinio
{
namespace websocket
{
namespace basic
{
class ws_t;
using ws_handle_t = std::shared_ptr< ws_t >;
namespace impl
{
//
// ws_connection_base_t
//
class ws_connection_base_t
: public tcp_connection_ctx_base_t
{
public:
ws_connection_base_t( connection_id_t id )
: tcp_connection_ctx_base_t{ id }
{}
virtual void
shutdown() = 0;
virtual void
kill() = 0;
virtual void
init_read( ws_handle_t wsh ) = 0;
virtual void
write_data(
write_group_t wg,
bool is_close_frame ) = 0;
};
using ws_connection_handle_t = std::shared_ptr< ws_connection_base_t >;
} /* namespace impl */
} /* namespace basic */
} /* namespace websocket */
} /* 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