MySQL 9.1.0
Source Code Documentation
http::base::Connection< IOLayer > Class Template Reference

#include <connection.h>

Inheritance diagram for http::base::Connection< IOLayer >:
[legend]

Public Types

using This = Connection< IOLayer >
 
using ConnectionStatusCallbacks = http::base::ConnectionStatusCallbacks< This >
 
using Methods = base::method::Bitset
 
using Headers = http::base::Headers
 
using owned_buffer = http::base::details::owned_buffer
 
using ref_buffers = http::base::details::ref_buffers< std::list< owned_buffer > >
 
using IO = IOLayer
 
- Public Types inherited from http::base::ConnectionInterface
using IOBuffer = http::base::IOBuffer
 
using Headers = http::base::Headers
 

Public Member Functions

 Connection (IOLayer s, base::method::Bitset *allowed_method, ConnectionStatusCallbacks *connection_handler, CNO_CONNECTION_KIND kind, CNO_HTTP_VERSION version)
 
 ~Connection () override
 
bool send (const uint32_t *stream_id_ptr, const int status_code, const std::string &method, const std::string &path, const Headers &headers, const IOBuffer &data) override
 
std::string get_peer_address () const override
 
uint16_t get_peer_port () const override
 
IOLayer & get_socket ()
 
void start () override
 
- Public Member Functions inherited from http::base::ConnectionInterface
virtual ~ConnectionInterface ()
 
- Public Member Functions inherited from http::cno::CnoInterface
virtual ~CnoInterface ()
 
virtual int on_cno_message_head (const uint32_t session_id, const cno_message_t *message)=0
 
virtual int on_cno_message_body (const uint32_t session_id, const char *data, const size_t size)=0
 
virtual int on_cno_stream_end (const uint32_t id)=0
 
virtual int on_settings ()=0
 

Protected Member Functions

void do_net_send ()
 
void do_net_recv ()
 
Pending on_net_receive (const std::error_code &ec, std::size_t bytes_transferred)
 
Pending on_net_send (const std::error_code &ec, size_t size)
 
void resume ()
 
void suspend ()
 
bool stop_running ()
 Mark the connection that it should stop running. More...
 
virtual void on_output_buffer_empty ()
 
int on_cno_writev (const cno_buffer_t *buffer, size_t count) override
 
int on_cno_message_tail (const uint32_t session_id, const cno_tail_t *tail) override
 
int on_cno_stream_start (const uint32_t id) override
 
int on_cno_close () override
 

Protected Attributes

bool keep_alive_ {true}
 
IOLayer socket_
 
Methodsallowed_method_
 
cno_connection_t cno_
 
uint8_t input_buffer_ [512]
 
net::mutable_buffer input_mutable_buffer_ {net::buffer(input_buffer_)}
 
std::mutex output_buffer_mutex_
 
std::list< owned_bufferoutput_buffers_
 
std::atomic< bool > processed_request_ {false}
 
std::atomic< bool > output_pending_ {false}
 
std::atomic< bool > running_ {true}
 
std::atomic< bool > suspend_ {false}
 
ConnectionStatusCallbacksconnection_handler_
 

Member Typedef Documentation

◆ ConnectionStatusCallbacks

◆ Headers

template<typename IOLayer >
using http::base::Connection< IOLayer >::Headers = http::base::Headers

◆ IO

template<typename IOLayer >
using http::base::Connection< IOLayer >::IO = IOLayer

◆ Methods

template<typename IOLayer >
using http::base::Connection< IOLayer >::Methods = base::method::Bitset

◆ owned_buffer

template<typename IOLayer >
using http::base::Connection< IOLayer >::owned_buffer = http::base::details::owned_buffer

◆ ref_buffers

template<typename IOLayer >
using http::base::Connection< IOLayer >::ref_buffers = http::base::details::ref_buffers<std::list<owned_buffer> >

◆ This

template<typename IOLayer >
using http::base::Connection< IOLayer >::This = Connection<IOLayer>

Constructor & Destructor Documentation

◆ Connection()

template<typename IOLayer >
http::base::Connection< IOLayer >::Connection ( IOLayer  s,
base::method::Bitset allowed_method,
ConnectionStatusCallbacks connection_handler,
CNO_CONNECTION_KIND  kind,
CNO_HTTP_VERSION  version 
)
inline

◆ ~Connection()

template<typename IOLayer >
http::base::Connection< IOLayer >::~Connection ( )
inlineoverride

Member Function Documentation

◆ do_net_recv()

template<typename IOLayer >
void http::base::Connection< IOLayer >::do_net_recv ( )
inlineprotected

◆ do_net_send()

template<typename IOLayer >
void http::base::Connection< IOLayer >::do_net_send ( )
inlineprotected

◆ get_peer_address()

template<typename IOLayer >
std::string http::base::Connection< IOLayer >::get_peer_address ( ) const
inlineoverridevirtual

◆ get_peer_port()

template<typename IOLayer >
uint16_t http::base::Connection< IOLayer >::get_peer_port ( ) const
inlineoverridevirtual

◆ get_socket()

template<typename IOLayer >
IOLayer & http::base::Connection< IOLayer >::get_socket ( )
inline

◆ on_cno_close()

template<typename IOLayer >
int http::base::Connection< IOLayer >::on_cno_close ( )
inlineoverrideprotectedvirtual

◆ on_cno_message_tail()

template<typename IOLayer >
int http::base::Connection< IOLayer >::on_cno_message_tail ( const uint32_t  session_id,
const cno_tail_t *  tail 
)
inlineoverrideprotectedvirtual

◆ on_cno_stream_start()

template<typename IOLayer >
int http::base::Connection< IOLayer >::on_cno_stream_start ( const uint32_t  id)
inlineoverrideprotectedvirtual

◆ on_cno_writev()

template<typename IOLayer >
int http::base::Connection< IOLayer >::on_cno_writev ( const cno_buffer_t *  buffer,
size_t  count 
)
inlineoverrideprotectedvirtual

◆ on_net_receive()

template<typename IOLayer >
Pending http::base::Connection< IOLayer >::on_net_receive ( const std::error_code &  ec,
std::size_t  bytes_transferred 
)
inlineprotected

◆ on_net_send()

template<typename IOLayer >
Pending http::base::Connection< IOLayer >::on_net_send ( const std::error_code &  ec,
size_t  size 
)
inlineprotected

◆ on_output_buffer_empty()

template<typename IOLayer >
virtual void http::base::Connection< IOLayer >::on_output_buffer_empty ( )
inlineprotectedvirtual

◆ resume()

template<typename IOLayer >
void http::base::Connection< IOLayer >::resume ( )
inlineprotected

◆ send()

template<typename IOLayer >
bool http::base::Connection< IOLayer >::send ( const uint32_t *  stream_id_ptr,
const int  status_code,
const std::string &  method,
const std::string &  path,
const Headers headers,
const IOBuffer data 
)
inlineoverridevirtual

◆ start()

template<typename IOLayer >
void http::base::Connection< IOLayer >::start ( )
inlineoverridevirtual

◆ stop_running()

template<typename IOLayer >
bool http::base::Connection< IOLayer >::stop_running ( )
inlineprotected

Mark the connection that it should stop running.

Returns
information if the object may be delete
Return values
'false'Connection object can be removed immediately
'true'Connection object must wait until IO is finished.

◆ suspend()

template<typename IOLayer >
void http::base::Connection< IOLayer >::suspend ( )
inlineprotected

Member Data Documentation

◆ allowed_method_

template<typename IOLayer >
Methods* http::base::Connection< IOLayer >::allowed_method_
protected

◆ cno_

template<typename IOLayer >
cno_connection_t http::base::Connection< IOLayer >::cno_
protected

◆ connection_handler_

template<typename IOLayer >
ConnectionStatusCallbacks* http::base::Connection< IOLayer >::connection_handler_
protected

◆ input_buffer_

template<typename IOLayer >
uint8_t http::base::Connection< IOLayer >::input_buffer_[512]
protected

◆ input_mutable_buffer_

template<typename IOLayer >
net::mutable_buffer http::base::Connection< IOLayer >::input_mutable_buffer_ {net::buffer(input_buffer_)}
protected

◆ keep_alive_

template<typename IOLayer >
bool http::base::Connection< IOLayer >::keep_alive_ {true}
protected

◆ output_buffer_mutex_

template<typename IOLayer >
std::mutex http::base::Connection< IOLayer >::output_buffer_mutex_
protected

◆ output_buffers_

template<typename IOLayer >
std::list<owned_buffer> http::base::Connection< IOLayer >::output_buffers_
protected

◆ output_pending_

template<typename IOLayer >
std::atomic<bool> http::base::Connection< IOLayer >::output_pending_ {false}
protected

◆ processed_request_

template<typename IOLayer >
std::atomic<bool> http::base::Connection< IOLayer >::processed_request_ {false}
protected

◆ running_

template<typename IOLayer >
std::atomic<bool> http::base::Connection< IOLayer >::running_ {true}
protected

◆ socket_

template<typename IOLayer >
IOLayer http::base::Connection< IOLayer >::socket_
protected

◆ suspend_

template<typename IOLayer >
std::atomic<bool> http::base::Connection< IOLayer >::suspend_ {false}
protected

The documentation for this class was generated from the following file: