MySQL 8.0.39
Source Code Documentation
|
container of sockets. More...
#include <socket_container.h>
Public Types | |
using | protocol_type = Protocol |
using | socket_type = typename protocol_type::socket |
using | container_type = std::list< socket_type > |
Public Member Functions | |
socket_type & | push_back (socket_type &&sock) |
move ownership of socket_type to the container. More... | |
template<class... Args> | |
socket_type & | emplace_back (Args &&... args) |
move ownership of socket_type to the container. More... | |
socket_type | release (socket_type &client_sock) |
release socket from container. More... | |
socket_type | release_unlocked (socket_type &client_sock) |
template<class F > | |
auto | run (F &&f) |
void | disconnect_all () |
disconnect all sockets. More... | |
bool | empty () const |
check if the container is empty. More... | |
size_t | size () const |
get size of container. More... | |
Private Attributes | |
container_type | sockets_ |
std::mutex | mtx_ |
container of sockets.
allows to disconnect all of them.
thread-safe.
using SocketContainer< Protocol >::container_type = std::list<socket_type> |
using SocketContainer< Protocol >::protocol_type = Protocol |
using SocketContainer< Protocol >::socket_type = typename protocol_type::socket |
|
inline |
disconnect all sockets.
|
inline |
move ownership of socket_type to the container.
|
inline |
check if the container is empty.
|
inline |
move ownership of socket_type to the container.
|
inline |
release socket from container.
moves ownership of the socket to the caller.
|
inline |
|
inline |
get size of container.
|
mutableprivate |
|
private |