|
dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
|
macOS: a client's connection to a service - a launchd mach service, or a listener below it - over XPC More...
#include <dx_service_transport.h>
Public Member Functions | |
| connection(const connection &)= delete | |
| connection(const connection &)= delete | |
| connection(const std::string& id) | |
| connection(const std::string& id) | |
| void | free() noexcept override |
| size_t | ioctl(uint32_t ioctl, const void* tx, size_t tx_size, void* rx, size_t rx_size) |
| one round trip: the request's data out, the reply's in - its size answered, its result thrown | |
| size_t | ioctl(uint32_t ioctl, const void* tx, size_t tx_size, void* rx, size_t rx_size) |
| one round trip: the request's data out, the reply's in - its size answered, its result thrown | |
| operator const os_event() const noexcept | |
| operator os_event() noexcept | |
| operator ::HANDLE() const noexcept | |
| void | run() |
| the service's first answer: the status follows | |
| void | run() |
| the read thread started, its first connection tried: a round trip goes where it succeeded | |
| void | send(const std::vector<uint8_t>& message) |
| ~connection() | |
| ~connection() override | |
Public Attributes | |
| listen<std::function<void()>> | broadcast |
| the service's signal: whatever of it is mirrored reads itself back | |
| promoted<os_result> | status{driver_not_connected} |
| ok while the service answers | |
Protected Member Functions | |
| const message* | receive(std::stop_token& stop_token) noexcept |
| the next message whole, its sizes checked - none where the pipe ended, stops or carried no message | |
| std::optional<::DWORD> | wait(::OVERLAPPED& overlapped, std::stop_token& stop_token) noexcept |
| an overlapped operation's end, waited for against the stop token: its size, or none where it failed or stops | |
Static Protected Member Functions | |
| static std::string | name(const std::string& id) |
Protected Attributes | |
| ::HANDLE | handle{invalid_t} |
| ::HANDLE | process{::GetCurrentProcess()} |
macOS: a client's connection to a service - a launchd mach service, or a listener below it - over XPC
Windows: a client's connection to a service's named pipe.
A round trip is one message and its reply; the service's broadcast is a message of its own, whose listeners run on a queue of the connection's own: a round trip never waits on the queue its reply arrives on. The connection follows the service: a service that ended (XPC_ERROR_CONNECTION_INTERRUPTED) is asked again at once - launchd starts it on demand - and status turns ok when it answers.
Its read thread connects - again whenever the service went: the service signals its pipe's shared event for every instance it listens with - and hands a reply to the round trip waiting for it. The status and the service's broadcast reach their listeners on the thread pool, never on the read thread: a listener's round trip waits for its reply there. A round trip is one at a time; the connection's end wakes it.
|
inline |
|
delete |
|
inline |
|
inline |
|
delete |
|
inlineoverride |
|
inlineoverridevirtualnoexcept |
Reimplemented from dx::resource< invalid_t >.
|
inline |
one round trip: the request's data out, the reply's in - its size answered, its result thrown
|
inline |
one round trip: the request's data out, the reply's in - its size answered, its result thrown
|
inlinestaticprotectedinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlineprotectednoexceptinherited |
the next message whole, its sizes checked - none where the pipe ended, stops or carried no message
|
inline |
the service's first answer: the status follows
|
inline |
the read thread started, its first connection tried: a round trip goes where it succeeded
|
inlineinherited |
|
inlineprotectednoexceptinherited |
an overlapped operation's end, waited for against the stop token: its size, or none where it failed or stops
| listen<std::function<void()>> dx::service::platform::connection::broadcast |
the service's signal: whatever of it is mirrored reads itself back
|
protectedinherited |
|
protectedinherited |
| promoted<os_result> dx::service::platform::connection::status{driver_not_connected} |
ok while the service answers