MySQL 8.4.1
Source Code Documentation
http::server::ServerConnection< Socket > Class Template Reference

#include <connection.h>

Inheritance diagram for http::server::ServerConnection< Socket >:
[legend]

Public Types

using Parent = http::base::Connection< Socket >
 
using SessionId = uint32_t
 
using ConnectionStatusCallbacks = typename Parent::ConnectionStatusCallbacks
 
- Public Types inherited from http::base::Connection< Socket >
using This = Connection< Socket >
 
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 = Socket
 
- Public Types inherited from http::base::ConnectionInterface
using IOBuffer = http::base::IOBuffer
 
using Headers = http::base::Headers
 

Public Member Functions

 ServerConnection (Socket s, base::method::Bitset *allowed_method, RequestHandlerInterface *rhi, ConnectionStatusCallbacks *connection_handler)
 
- Public Member Functions inherited from http::base::Connection< Socket >
 Connection (Socket s, base::method::Bitset *allowed_method, ConnectionStatusCallbacks *connection_handler, CNO_CONNECTION_KIND kind)
 
 ~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
 
Socket & 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 ()
 

Private Member Functions

int on_cno_message_body (const uint32_t session_id, const char *data, const size_t size) override
 
int on_cno_message_tail (const uint32_t session_id, const cno_tail_t *tail) override
 
int on_cno_stream_end (const uint32_t id) override
 
int on_cno_message_head (const uint32_t session_id, const cno_message_t *msg) override
 

Private Attributes

bool first_request_ {true}
 
std::map< SessionId, ServerRequestsessions_
 
RequestHandlerInterfacerequest_handler_
 

Additional Inherited Members

- Protected Member Functions inherited from http::base::Connection< Socket >
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 inherited from http::base::Connection< Socket >
bool keep_alive_
 
Socket socket_
 
Methodsallowed_method_
 
cno_connection_t cno_
 
uint8_t input_buffer_ [512]
 
net::mutable_buffer input_mutable_buffer_
 
std::mutex output_buffer_mutex_
 
std::list< owned_bufferoutput_buffers_
 
std::atomic< bool > processed_request_
 
std::atomic< bool > output_pending_
 
std::atomic< bool > running_
 
std::atomic< bool > suspend_
 
ConnectionStatusCallbacksconnection_handler_
 

Member Typedef Documentation

◆ ConnectionStatusCallbacks

◆ Parent

◆ SessionId

template<typename Socket >
using http::server::ServerConnection< Socket >::SessionId = uint32_t

Constructor & Destructor Documentation

◆ ServerConnection()

template<typename Socket >
http::server::ServerConnection< Socket >::ServerConnection ( Socket  s,
base::method::Bitset allowed_method,
RequestHandlerInterface rhi,
ConnectionStatusCallbacks connection_handler 
)
inline

Member Function Documentation

◆ on_cno_message_body()

template<typename Socket >
int http::server::ServerConnection< Socket >::on_cno_message_body ( const uint32_t  session_id,
const char *  data,
const size_t  size 
)
inlineoverrideprivatevirtual

◆ on_cno_message_head()

template<typename Socket >
int http::server::ServerConnection< Socket >::on_cno_message_head ( const uint32_t  session_id,
const cno_message_t *  msg 
)
inlineoverrideprivatevirtual

◆ on_cno_message_tail()

template<typename Socket >
int http::server::ServerConnection< Socket >::on_cno_message_tail ( const uint32_t  session_id,
const cno_tail_t *  tail 
)
inlineoverrideprivatevirtual

◆ on_cno_stream_end()

template<typename Socket >
int http::server::ServerConnection< Socket >::on_cno_stream_end ( const uint32_t  id)
inlineoverrideprivatevirtual

Member Data Documentation

◆ first_request_

template<typename Socket >
bool http::server::ServerConnection< Socket >::first_request_ {true}
private

◆ request_handler_

template<typename Socket >
RequestHandlerInterface* http::server::ServerConnection< Socket >::request_handler_
private

◆ sessions_

template<typename Socket >
std::map<SessionId, ServerRequest> http::server::ServerConnection< Socket >::sessions_
private

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