RESTinio
Protected Member Functions | Private Attributes | List of all members
restinio::impl::socket_supplier_t< Socket > Class Template Reference

#include <acceptor.hpp>

Protected Member Functions

template<typename Settings >
 socket_supplier_t (Settings &settings, asio_ns::io_context &io_context)
 
Socket & socket (std::size_t idx)
 Get the reference to socket. More...
 
Socket move_socket (std::size_t idx)
 Extract the socket via move. More...
 
auto cuncurrent_accept_sockets_count () const noexcept
 The number of sockets that can be used for cuncurrent accept operations. More...
 

Private Attributes

asio_ns::io_context & m_io_context
 io_context for sockets to run on. More...
 
std::vector< Socket > m_sockets
 A temporary socket for receiving new connections. More...
 

Detailed Description

template<typename Socket>
class restinio::impl::socket_supplier_t< Socket >

Definition at line 38 of file acceptor.hpp.

Constructor & Destructor Documentation

◆ socket_supplier_t()

template<typename Socket>
template<typename Settings >
restinio::impl::socket_supplier_t< Socket >::socket_supplier_t ( Settings &  settings,
asio_ns::io_context &  io_context 
)
inlineprotected
Parameters
settingsServer settings.
io_contextA context the server runs on.

Definition at line 42 of file acceptor.hpp.

Member Function Documentation

◆ cuncurrent_accept_sockets_count()

template<typename Socket>
auto restinio::impl::socket_supplier_t< Socket >::cuncurrent_accept_sockets_count ( ) const
inlineprotectednoexcept

The number of sockets that can be used for cuncurrent accept operations.

Definition at line 82 of file acceptor.hpp.

◆ move_socket()

template<typename Socket>
Socket restinio::impl::socket_supplier_t< Socket >::move_socket ( std::size_t  idx)
inlineprotected

Extract the socket via move.

Parameters
idxIndex of a socket in the pool.

Definition at line 72 of file acceptor.hpp.

◆ socket()

template<typename Socket>
Socket& restinio::impl::socket_supplier_t< Socket >::socket ( std::size_t  idx)
inlineprotected

Get the reference to socket.

Parameters
idxIndex of a socket in the pool.

Definition at line 63 of file acceptor.hpp.

Member Data Documentation

◆ m_io_context

template<typename Socket>
asio_ns::io_context& restinio::impl::socket_supplier_t< Socket >::m_io_context
private

io_context for sockets to run on.

Definition at line 89 of file acceptor.hpp.

◆ m_sockets

template<typename Socket>
std::vector< Socket > restinio::impl::socket_supplier_t< Socket >::m_sockets
private

A temporary socket for receiving new connections.

Note
Must never be empty.

Definition at line 93 of file acceptor.hpp.


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