MySQL 8.3.0
Source Code Documentation
net::basic_socket_acceptor< AcceptableProtocol > Class Template Reference

#include <socket.h>

Inheritance diagram for net::basic_socket_acceptor< AcceptableProtocol >:
[legend]

Public Types

using executor_type = io_context::executor_type
 
using native_handle_type = impl::socket::native_handle_type
 
using protocol_type = AcceptableProtocol
 
using socket_type = typename protocol_type::socket
 
using endpoint_type = typename protocol_type::endpoint
 
using error_type = std::error_code
 
- Public Types inherited from net::socket_base
enum class  shutdown_type { shutdown_receive = SHUT_RD , shutdown_send = SHUT_WR , shutdown_both = SHUT_RDWR }
 
using broadcast = socket_option::boolean< SOL_SOCKET, SO_BROADCAST >
 
using debug = socket_option::boolean< SOL_SOCKET, SO_DEBUG >
 
using do_not_route = socket_option::boolean< SOL_SOCKET, SO_DONTROUTE >
 
using error = socket_option::integer< SOL_SOCKET, SO_ERROR >
 
using keep_alive = socket_option::boolean< SOL_SOCKET, SO_KEEPALIVE >
 
using out_of_band_inline = socket_option::boolean< SOL_SOCKET, SO_OOBINLINE >
 
using receive_buffer_size = socket_option::integer< SOL_SOCKET, SO_RCVBUF >
 
using receive_low_watermark = socket_option::integer< SOL_SOCKET, SO_RCVLOWAT >
 
using reuse_address = socket_option::boolean< SOL_SOCKET, SO_REUSEADDR >
 
using send_buffer_size = socket_option::integer< SOL_SOCKET, SO_SNDBUF >
 
using send_low_watermark = socket_option::integer< SOL_SOCKET, SO_SNDLOWAT >
 
using message_flags = impl::socket::message_flags
 
using wait_type = impl::socket::wait_type
 

Public Member Functions

 basic_socket_acceptor (io_context &ctx)
 
executor_type get_executor () noexcept
 
stdx::expected< void, error_typeopen (const protocol_type &protocol=protocol_type(), int flags=0)
 
stdx::expected< void, error_typeassign (const protocol_type &protocol, const native_handle_type &native_acceptor)
 
stdx::expected< native_handle_type, error_typerelease ()
 
native_handle_type native_handle () const
 
constexpr bool is_open () const
 
stdx::expected< void, error_typeclose ()
 
stdx::expected< void, error_typecancel ()
 
template<typename SettableSocketOption >
stdx::expected< void, error_typeset_option (const SettableSocketOption &option)
 
template<typename GettableSocketOption >
stdx::expected< void, error_typeget_option (GettableSocketOption &option) const
 
bool non_blocking () const
 
stdx::expected< void, std::error_code > non_blocking (bool mode)
 
bool native_non_blocking () const
 
stdx::expected< void, std::error_code > native_non_blocking (bool mode)
 
stdx::expected< void, error_typebind (const endpoint_type &endpoint)
 
stdx::expected< void, error_typelisten (int backlog)
 
stdx::expected< endpoint_type, error_typelocal_endpoint () const
 
bool enable_connection_aborted () const
 
stdx::expected< socket_type, error_typeaccept (int flags=0)
 
stdx::expected< socket_type, error_typeaccept (io_context &io_ctx, int flags=0)
 
stdx::expected< socket_type, error_typeaccept (endpoint_type &endpoint, int flags=0)
 
stdx::expected< socket_type, error_typeaccept (io_context &io_ctx, endpoint_type &endpoint, int flags=0)
 
template<class CompletionToken >
auto async_accept (io_context &io_ctx, CompletionToken &&token)
 
template<class CompletionToken >
auto async_accept (endpoint_type &endpoint, CompletionToken &&token)
 
template<class CompletionToken >
auto async_accept (io_context &io_ctx, endpoint_type &endpoint, CompletionToken &&token)
 accept a connection with endpoint async'. More...
 
template<class CompletionToken >
auto async_accept (CompletionToken &&token)
 
stdx::expected< void, std::error_code > wait (socket_base::wait_type wt)
 
template<typename CompletionToken >
auto async_wait (wait_type w, CompletionToken &&token)
 

Private Types

using __base = basic_socket_impl< AcceptableProtocol >
 
- Private Types inherited from net::basic_socket_impl< AcceptableProtocol >
using __base = basic_socket_impl_base
 
using executor_type = io_context::executor_type
 
using protocol_type = AcceptableProtocol
 
using endpoint_type = typename protocol_type::endpoint
 
using error_type = std::error_code
 
using socket_type = typename protocol_type::socket
 
using io_control_bytes_avail_recv = IoControl< FIONREAD, int >
 
using io_control_at_mark = IoControl< SIOCATMARK, int >
 
using io_control_bytes_avail_send = IoControl< TIOCOUTQ, int >
 
- Private Types inherited from net::basic_socket_impl_base
using native_handle_type = impl::socket::native_handle_type
 
using executor_type = io_context::executor_type
 

Private Attributes

protocol_type protocol_
 
bool enable_connection_aborted_ {false}
 
- Private Attributes inherited from net::basic_socket_impl_base
native_handle_type native_handle_ {impl::socket::kInvalidSocket}
 
bool non_blocking_ {false}
 
char native_non_blocking_
 
io_contextio_ctx_
 

Additional Inherited Members

- Static Public Attributes inherited from net::socket_base
static constexpr message_flags message_peek = impl::socket::message_peek
 
static constexpr message_flags message_out_of_band
 
static constexpr message_flags message_do_not_route
 
static constexpr wait_type wait_read = wait_type::wait_read
 
static constexpr wait_type wait_write = wait_type::wait_write
 
static constexpr wait_type wait_error = wait_type::wait_error
 
static constexpr shutdown_type shutdown_receive
 
static constexpr shutdown_type shutdown_send = shutdown_type::shutdown_send
 
static constexpr shutdown_type shutdown_both = shutdown_type::shutdown_both
 
static const int max_listen_connections {SOMAXCONN}
 
- Private Member Functions inherited from net::basic_socket_impl< AcceptableProtocol >
constexpr basic_socket_impl (io_context &ctx) noexcept
 
 basic_socket_impl (const basic_socket_impl &)=delete
 
 basic_socket_impl (basic_socket_impl &&rhs)=default
 
basic_socket_imploperator= (const basic_socket_impl &)=delete
 
basic_socket_imploperator= (basic_socket_impl &&rhs) noexcept
 
 ~basic_socket_impl ()
 
stdx::expected< void, error_typeopen (const protocol_type &protocol=protocol_type(), int flags=0)
 
stdx::expected< void, error_typeassign (const protocol_type &protocol, const native_handle_type &native_handle)
 
stdx::expected< void, error_typebind (const endpoint_type &endpoint)
 
stdx::expected< socket_type, error_typeaccept (io_context &io_ctx, struct sockaddr *endpoint_data, socklen_t *endpoint_size, int flags=0)
 
stdx::expected< socket_type, error_typeaccept (io_context &io_ctx, int flags=0)
 
stdx::expected< socket_type, error_typeaccept (io_context &io_ctx, endpoint_type &endpoint, int flags=0)
 
stdx::expected< void, error_typelisten (int backlog=socket_base::max_listen_connections)
 
stdx::expected< void, error_typeset_option (const SettableSocketOption &option)
 
stdx::expected< void, error_typeget_option (GettableSocketOption &option) const
 
stdx::expected< endpoint_type, error_typelocal_endpoint () const
 
stdx::expected< endpoint_type, error_typeremote_endpoint () const
 
stdx::expected< void, error_typeio_control (IoControlCommand &cmd) const
 
stdx::expected< size_t, error_typeavailable () const
 
stdx::expected< bool, error_typeat_mark () const
 
stdx::expected< void, error_typeshutdown (socket_base::shutdown_type st) const
 
stdx::expected< void, std::error_code > wait (socket_base::wait_type wt)
 
- Private Member Functions inherited from net::basic_socket_impl_base
constexpr basic_socket_impl_base (io_context &ctx)
 
 basic_socket_impl_base (const basic_socket_impl_base &rhs)=delete
 
basic_socket_impl_baseoperator= (const basic_socket_impl_base &rhs)=delete
 
 basic_socket_impl_base (basic_socket_impl_base &&rhs) noexcept
 
basic_socket_impl_baseoperator= (basic_socket_impl_base &&rhs) noexcept
 
 ~basic_socket_impl_base ()=default
 
constexpr native_handle_type native_handle () const noexcept
 
constexpr bool is_open () const noexcept
 
constexpr bool non_blocking () const
 
stdx::expected< void, std::error_code > non_blocking (bool mode)
 
bool native_non_blocking () const
 
stdx::expected< void, std::error_code > native_non_blocking (bool mode)
 
executor_type get_executor () noexcept
 
stdx::expected< void, std::error_code > close ()
 
stdx::expected< void, std::error_code > cancel ()
 
stdx::expected< native_handle_type, std::error_code > release ()
 

Member Typedef Documentation

◆ __base

template<typename AcceptableProtocol >
using net::basic_socket_acceptor< AcceptableProtocol >::__base = basic_socket_impl<AcceptableProtocol>
private

◆ endpoint_type

template<typename AcceptableProtocol >
using net::basic_socket_acceptor< AcceptableProtocol >::endpoint_type = typename protocol_type::endpoint

◆ error_type

template<typename AcceptableProtocol >
using net::basic_socket_acceptor< AcceptableProtocol >::error_type = std::error_code

◆ executor_type

template<typename AcceptableProtocol >
using net::basic_socket_acceptor< AcceptableProtocol >::executor_type = io_context::executor_type

◆ native_handle_type

template<typename AcceptableProtocol >
using net::basic_socket_acceptor< AcceptableProtocol >::native_handle_type = impl::socket::native_handle_type

◆ protocol_type

template<typename AcceptableProtocol >
using net::basic_socket_acceptor< AcceptableProtocol >::protocol_type = AcceptableProtocol

◆ socket_type

template<typename AcceptableProtocol >
using net::basic_socket_acceptor< AcceptableProtocol >::socket_type = typename protocol_type::socket

Constructor & Destructor Documentation

◆ basic_socket_acceptor()

template<typename AcceptableProtocol >
net::basic_socket_acceptor< AcceptableProtocol >::basic_socket_acceptor ( io_context ctx)
inlineexplicit

Member Function Documentation

◆ accept() [1/4]

template<typename AcceptableProtocol >
stdx::expected< socket_type, error_type > net::basic_socket_acceptor< AcceptableProtocol >::accept ( endpoint_type endpoint,
int  flags = 0 
)
inline

◆ accept() [2/4]

template<typename AcceptableProtocol >
stdx::expected< socket_type, error_type > net::basic_socket_acceptor< AcceptableProtocol >::accept ( int  flags = 0)
inline

◆ accept() [3/4]

template<typename AcceptableProtocol >
stdx::expected< socket_type, error_type > net::basic_socket_acceptor< AcceptableProtocol >::accept ( io_context io_ctx,
endpoint_type endpoint,
int  flags = 0 
)
inline

◆ accept() [4/4]

template<typename AcceptableProtocol >
stdx::expected< socket_type, error_type > net::basic_socket_acceptor< AcceptableProtocol >::accept ( io_context io_ctx,
int  flags = 0 
)
inline

◆ assign()

template<typename AcceptableProtocol >
stdx::expected< void, error_type > net::basic_socket_acceptor< AcceptableProtocol >::assign ( const protocol_type protocol,
const native_handle_type native_acceptor 
)
inline

◆ async_accept() [1/4]

template<typename AcceptableProtocol >
template<class CompletionToken >
auto net::basic_socket_acceptor< AcceptableProtocol >::async_accept ( CompletionToken &&  token)
inline

◆ async_accept() [2/4]

template<typename AcceptableProtocol >
template<class CompletionToken >
auto net::basic_socket_acceptor< AcceptableProtocol >::async_accept ( endpoint_type endpoint,
CompletionToken &&  token 
)
inline

◆ async_accept() [3/4]

template<typename AcceptableProtocol >
template<class CompletionToken >
auto net::basic_socket_acceptor< AcceptableProtocol >::async_accept ( io_context io_ctx,
CompletionToken &&  token 
)
inline

◆ async_accept() [4/4]

template<typename AcceptableProtocol >
template<class CompletionToken >
auto net::basic_socket_acceptor< AcceptableProtocol >::async_accept ( io_context io_ctx,
endpoint_type endpoint,
CompletionToken &&  token 
)
inline

accept a connection with endpoint async'.

  • returns immediately
  • calls completiontoken when finished
Parameters
[in,out]io_ctxio-context to execute the waiting/execution in
[out]endpointremote endpoint of the accepted connection
[in]tokencompletion token of type 'void(std::error_code, socket_type)'

◆ async_wait()

template<typename AcceptableProtocol >
template<typename CompletionToken >
auto net::basic_socket_acceptor< AcceptableProtocol >::async_wait ( wait_type  w,
CompletionToken &&  token 
)
inline

◆ bind()

template<typename AcceptableProtocol >
stdx::expected< void, error_type > net::basic_socket_acceptor< AcceptableProtocol >::bind ( const endpoint_type endpoint)
inline

◆ cancel()

template<typename AcceptableProtocol >
stdx::expected< void, error_type > net::basic_socket_acceptor< AcceptableProtocol >::cancel ( )
inline

◆ close()

template<typename AcceptableProtocol >
stdx::expected< void, error_type > net::basic_socket_acceptor< AcceptableProtocol >::close ( )
inline

◆ enable_connection_aborted()

template<typename AcceptableProtocol >
bool net::basic_socket_acceptor< AcceptableProtocol >::enable_connection_aborted ( ) const
inline

◆ get_executor()

template<typename AcceptableProtocol >
executor_type net::basic_socket_acceptor< AcceptableProtocol >::get_executor ( )
inlinenoexcept

◆ get_option()

template<typename AcceptableProtocol >
template<typename GettableSocketOption >
stdx::expected< void, error_type > net::basic_socket_acceptor< AcceptableProtocol >::get_option ( GettableSocketOption &  option) const
inline

◆ is_open()

template<typename AcceptableProtocol >
constexpr bool net::basic_socket_acceptor< AcceptableProtocol >::is_open ( ) const
inlineconstexpr

◆ listen()

template<typename AcceptableProtocol >
stdx::expected< void, error_type > net::basic_socket_acceptor< AcceptableProtocol >::listen ( int  backlog)
inline

◆ local_endpoint()

template<typename AcceptableProtocol >
stdx::expected< endpoint_type, error_type > net::basic_socket_acceptor< AcceptableProtocol >::local_endpoint ( ) const
inline

◆ native_handle()

template<typename AcceptableProtocol >
native_handle_type net::basic_socket_acceptor< AcceptableProtocol >::native_handle ( ) const
inline

◆ native_non_blocking() [1/2]

template<typename AcceptableProtocol >
bool net::basic_socket_acceptor< AcceptableProtocol >::native_non_blocking ( ) const
inline

◆ native_non_blocking() [2/2]

template<typename AcceptableProtocol >
stdx::expected< void, std::error_code > net::basic_socket_acceptor< AcceptableProtocol >::native_non_blocking ( bool  mode)
inline

◆ non_blocking() [1/2]

template<typename AcceptableProtocol >
bool net::basic_socket_acceptor< AcceptableProtocol >::non_blocking ( ) const
inline

◆ non_blocking() [2/2]

template<typename AcceptableProtocol >
stdx::expected< void, std::error_code > net::basic_socket_acceptor< AcceptableProtocol >::non_blocking ( bool  mode)
inline

◆ open()

template<typename AcceptableProtocol >
stdx::expected< void, error_type > net::basic_socket_acceptor< AcceptableProtocol >::open ( const protocol_type protocol = protocol_type(),
int  flags = 0 
)
inline

◆ release()

template<typename AcceptableProtocol >
stdx::expected< native_handle_type, error_type > net::basic_socket_acceptor< AcceptableProtocol >::release ( )
inline

◆ set_option()

template<typename AcceptableProtocol >
template<typename SettableSocketOption >
stdx::expected< void, error_type > net::basic_socket_acceptor< AcceptableProtocol >::set_option ( const SettableSocketOption &  option)
inline

◆ wait()

template<typename AcceptableProtocol >
stdx::expected< void, std::error_code > net::basic_socket_acceptor< AcceptableProtocol >::wait ( socket_base::wait_type  wt)
inline

Member Data Documentation

◆ enable_connection_aborted_

template<typename AcceptableProtocol >
bool net::basic_socket_acceptor< AcceptableProtocol >::enable_connection_aborted_ {false}
private

◆ protocol_

template<typename AcceptableProtocol >
protocol_type net::basic_socket_acceptor< AcceptableProtocol >::protocol_
private

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