server - accepts multiple concurrent pipe client connections Each accepted connection is served by its own pipe::server::instance, running on a dedicated read thread. run() keeps exactly one instance listening for the next client at all times: once ConnectNamedPipe() accepts a connection, that instance's own thread calls server::run() again - reaping already-concluded instances and spawning the next listener - before servicing its own connection. A concluded instance (client disconnected) therefore joins only at the start of the next run(), on a different thread: a std::jthread cannot join itself, so reaping cannot happen from within the concluding instance's own read thread. An otherwise idle server thus keeps its most recently used instance around until either the next connection or stop(), which unconditionally joins every instance - connected or not - synchronously before returning.
More...
#include <dx_pipe.h>
|
| struct | access |
| | how the pipe is created where the caller names nothing: a duplex message pipe, overlapped More...
|
| class | instance |
| | one accepted client connection, on a read thread of its own More...
|
|
| template<typename snd_t> |
| const snd_t & | operator<< (const snd_t &snd) |
| void | run () |
| | server (const std::string &id, arg_t... args) |
| | server (const std::string &id, const ::DWORD(&access)[2], arg_t... args) |
| | server (const std::string &id, typename decltype(listen)::listeners &&listeners, arg_t... args) |
| | server (const std::string &id, typename decltype(listen)::listeners &&listeners, const ::DWORD(&access)[2], arg_t... args) |
| void | stop () noexcept |
| | ~server () |
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
class dx::pipe< rcv_t >::server< instance_t, arg_t >
server - accepts multiple concurrent pipe client connections Each accepted connection is served by its own pipe::server::instance, running on a dedicated read thread. run() keeps exactly one instance listening for the next client at all times: once ConnectNamedPipe() accepts a connection, that instance's own thread calls server::run() again - reaping already-concluded instances and spawning the next listener - before servicing its own connection. A concluded instance (client disconnected) therefore joins only at the start of the next run(), on a different thread: a std::jthread cannot join itself, so reaping cannot happen from within the concluding instance's own read thread. An otherwise idle server thus keeps its most recently used instance around until either the next connection or stop(), which unconditionally joins every instance - connected or not - synchronously before returning.
◆ server() [1/4]
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
| dx::pipe< rcv_t >::server< instance_t, arg_t >::server |
( |
const std::string & | id, |
|
|
typename decltype(listen)::listeners && | listeners, |
|
|
const ::DWORD(&) | access[2], |
|
|
arg_t... | args ) |
|
inline |
◆ server() [2/4]
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
| dx::pipe< rcv_t >::server< instance_t, arg_t >::server |
( |
const std::string & | id, |
|
|
typename decltype(listen)::listeners && | listeners, |
|
|
arg_t... | args ) |
|
inline |
◆ server() [3/4]
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
| dx::pipe< rcv_t >::server< instance_t, arg_t >::server |
( |
const std::string & | id, |
|
|
const ::DWORD(&) | access[2], |
|
|
arg_t... | args ) |
|
inline |
◆ server() [4/4]
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
| dx::pipe< rcv_t >::server< instance_t, arg_t >::server |
( |
const std::string & | id, |
|
|
arg_t... | args ) |
|
inline |
◆ ~server()
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
◆ operator<<()
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
template<typename snd_t>
| const snd_t & dx::pipe< rcv_t >::server< instance_t, arg_t >::operator<< |
( |
const snd_t & | snd | ) |
|
|
inline |
◆ run()
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
◆ stop()
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
◆ access
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
◆ args
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
◆ id
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
◆ instance
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
◆ listen
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
◆ stopping
template<typename rcv_t>
template<typename instance_t = pipe, typename ... arg_t>
The documentation for this class was generated from the following file: