|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Receive operation state shared by all asynchronous handlers. More...
Collaboration diagram for profinet::AsioEthernetSocket::EthernetPacketBackend::ReceiveOperation:Public Types | |
| enum class | State : std::uint8_t { Pending , Received , TimedOut , Failed } |
Public Member Functions | |
| ReceiveOperation (asio::io_context &ioContext) | |
| Construct a receive operation with timers on the supplied context. | |
Public Attributes | |
| std::atomic< State > | state {State::Pending} |
| Completion state shared between asynchronous handlers. | |
| std::atomic< std::size_t > | pendingHandlers {0U} |
| Number of outstanding asynchronous handlers. | |
| std::promise< std::vector< std::uint8_t > > | completion |
| Wait used by the synchronous Recv() API. | |
| std::vector< std::uint8_t > | frame |
| Frame received by the packet handler. | |
| std::exception_ptr | error |
| Exception produced by a failed receive. | |
| std::mutex | resultMutex |
| Protects frame and error completion data. | |
| asio::steady_timer | timeoutTimer |
| Application-level receive timeout. | |
| asio::steady_timer | pollTimer |
| Polling fallback timer for non-selectable packet sources. | |
Receive operation state shared by all asynchronous handlers.
The operation state is heap-owned so no Asio callback ever references stack-local state belonging to Recv().
Definition at line 100 of file ethernetPacketBackend.h.
|
strong |
| Enumerator | |
|---|---|
| Pending | |
| Received | |
| TimedOut | |
| Failed | |
Definition at line 102 of file ethernetPacketBackend.h.
|
inlineexplicit |
Construct a receive operation with timers on the supplied context.
| ioContext | Asio execution context. |
Definition at line 112 of file ethernetPacketBackend.h.
| std::promise<std::vector<std::uint8_t> > profinet::AsioEthernetSocket::EthernetPacketBackend::ReceiveOperation::completion |
Wait used by the synchronous Recv() API.
Definition at line 124 of file ethernetPacketBackend.h.
| std::exception_ptr profinet::AsioEthernetSocket::EthernetPacketBackend::ReceiveOperation::error |
Exception produced by a failed receive.
Definition at line 130 of file ethernetPacketBackend.h.
| std::vector<std::uint8_t> profinet::AsioEthernetSocket::EthernetPacketBackend::ReceiveOperation::frame |
Frame received by the packet handler.
Definition at line 127 of file ethernetPacketBackend.h.
| std::atomic<std::size_t> profinet::AsioEthernetSocket::EthernetPacketBackend::ReceiveOperation::pendingHandlers {0U} |
Number of outstanding asynchronous handlers.
Definition at line 121 of file ethernetPacketBackend.h.
| asio::steady_timer profinet::AsioEthernetSocket::EthernetPacketBackend::ReceiveOperation::pollTimer |
Polling fallback timer for non-selectable packet sources.
Definition at line 139 of file ethernetPacketBackend.h.
| std::mutex profinet::AsioEthernetSocket::EthernetPacketBackend::ReceiveOperation::resultMutex |
Protects frame and error completion data.
Definition at line 133 of file ethernetPacketBackend.h.
| std::atomic<State> profinet::AsioEthernetSocket::EthernetPacketBackend::ReceiveOperation::state {State::Pending} |
Completion state shared between asynchronous handlers.
Definition at line 118 of file ethernetPacketBackend.h.
| asio::steady_timer profinet::AsioEthernetSocket::EthernetPacketBackend::ReceiveOperation::timeoutTimer |
Application-level receive timeout.
Definition at line 136 of file ethernetPacketBackend.h.