RESTinio
Public Member Functions | List of all members
restinio::connection_count_limits::impl::acceptor_callback_iface_t Class Referenceabstract

An interface of acceptor to be used by connection count limiters. More...

#include <connection_count_limiter.hpp>

Inheritance diagram for restinio::connection_count_limits::impl::acceptor_callback_iface_t:
restinio::impl::acceptor_t< Traits >

Public Member Functions

virtual void call_accept_now (std::size_t index) noexcept=0
 
virtual void schedule_next_accept_attempt (std::size_t index) noexcept=0
 

Detailed Description

An interface of acceptor to be used by connection count limiters.

An instance of a connection count limiter will receive a reference to the acceptor. The limiter has to call the acceptor and this interface declares methods of the acceptor that will be invoked by the limiter.

The assumed working scheme is:

Since
v.0.6.12

Definition at line 77 of file connection_count_limiter.hpp.

Member Function Documentation

◆ call_accept_now()

virtual void restinio::connection_count_limits::impl::acceptor_callback_iface_t::call_accept_now ( std::size_t  index)
pure virtualnoexcept

This method will be invoked by a limiter when there is a possibility to call accept() right now.

Parameters
indexAn index of socket's slot to be used for accept().

Implemented in restinio::impl::acceptor_t< Traits >.

◆ schedule_next_accept_attempt()

virtual void restinio::connection_count_limits::impl::acceptor_callback_iface_t::schedule_next_accept_attempt ( std::size_t  index)
pure virtualnoexcept

This method will be invoked by a limiter when there is no possibility to call accept() right now, but the next call to accept_next should be scheduled as soon as possible in the appropriate worker context.

It is assumed that the acceptor will use asio::post() with a completion handler that calls the accept_next method of the limiter.

Parameters
indexAn index of socket's slot to be used for accept().

Implemented in restinio::impl::acceptor_t< Traits >.


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