|
PROFINET IO Controller Stack 1.0.0
Modern C++ implementation of a PROFINET IO Controller stack
|
Synchronous UDP transport used by PROFINET DCE/RPC. More...
#include <rpcTransport.h>
Inheritance diagram for profinet::rpc::RpcTransport:
Collaboration diagram for profinet::rpc::RpcTransport:Public Member Functions | |
| RpcTransport (asio::io_context &ioContext) | |
| Create a transport using the supplied Asio execution context. | |
| void | Open (const std::string &address, std::uint16_t port, bool isListener=false) override |
| Open the UDP socket and configure the remote endpoint. | |
| Bytes | Receive (std::chrono::milliseconds timeout, asio::ip::udp::endpoint &remoteEndpoint) override |
| Wait for an incoming UDP datagram and capture the sender's endpoint. | |
| void | SendTo (const Bytes &data, const asio::ip::udp::endpoint &targetEndpoint) override |
| Send a UDP datagram to a specific remote endpoint. | |
| Bytes | SendReceive (const Bytes &data, std::chrono::milliseconds timeout) override |
| Send a UDP datagram and wait for one response. | |
| void | Send (const Bytes &data) override |
| Send a UDP datagram without waiting for a response. | |
| void | Close () noexcept override |
| Close the UDP socket. | |
| bool | IsOpen () const noexcept |
| Check whether the socket is open. | |
Public Member Functions inherited from profinet::rpc::IRpcTransport | |
| virtual | ~IRpcTransport ()=default |
Private Attributes | |
| asio::io_context & | ioContext |
| asio::ip::udp::socket | socket |
| asio::ip::udp::endpoint | endpoint |
Synchronous UDP transport used by PROFINET DCE/RPC.
Definition at line 17 of file rpcTransport.h.
|
explicit |
Create a transport using the supplied Asio execution context.
| ioContext | Asio execution context. |
Definition at line 57 of file rpcTransport.cpp.
|
overridevirtualnoexcept |
Close the UDP socket.
Implements profinet::rpc::IRpcTransport.
Definition at line 344 of file rpcTransport.cpp.
References socket.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Here is the caller graph for this function:
|
noexcept |
Check whether the socket is open.
Definition at line 355 of file rpcTransport.cpp.
References socket.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Here is the caller graph for this function:
|
overridevirtual |
Open the UDP socket and configure the remote endpoint.
| address | Remote IPv4 address. |
| port | Remote UDP port. |
| isListener | ... |
Implements profinet::rpc::IRpcTransport.
Definition at line 62 of file rpcTransport.cpp.
References endpoint, and socket.
Referenced by profinet::rpc::RPCCon::EpmLookup(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Here is the caller graph for this function:
|
overridevirtual |
Wait for an incoming UDP datagram and capture the sender's endpoint.
| timeout | Maximum wait time. | |
| [out] | remoteEndpoint | Receives the endpoint details of the sender. |
Implements profinet::rpc::IRpcTransport.
Definition at line 137 of file rpcTransport.cpp.
References completion, ioContext, and socket.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Here is the caller graph for this function:
|
overridevirtual |
Send a UDP datagram without waiting for a response.
| data | Datagram to send. |
Implements profinet::rpc::IRpcTransport.
Definition at line 319 of file rpcTransport.cpp.
References endpoint, and socket.
Referenced by TEST_F(), TEST_F(), and TEST_F().
Here is the caller graph for this function:
|
overridevirtual |
Send a UDP datagram and wait for one response.
| data | Datagram to send. |
| timeout | Maximum response wait time. |
| std::system_error | on transport failure. |
| RPCTimeoutError | when the timeout expires. |
Implements profinet::rpc::IRpcTransport.
Definition at line 236 of file rpcTransport.cpp.
References completion, endpoint, ioContext, and socket.
Referenced by profinet::rpc::RPCCon::EpmLookup(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Here is the caller graph for this function:
|
overridevirtual |
Send a UDP datagram to a specific remote endpoint.
| data | Datagram to send. |
| targetEndpoint | Destination UDP endpoint. |
Implements profinet::rpc::IRpcTransport.
Definition at line 209 of file rpcTransport.cpp.
References socket.
Referenced by TEST_F(), TEST_F(), and TEST_F().
Here is the caller graph for this function:
|
private |
Definition at line 63 of file rpcTransport.h.
Referenced by Open(), Send(), and SendReceive().
|
private |
Definition at line 61 of file rpcTransport.h.
Referenced by Receive(), and SendReceive().
|
private |
Definition at line 62 of file rpcTransport.h.
Referenced by Close(), IsOpen(), Open(), Receive(), Send(), SendReceive(), and SendTo().