|
GKD.RoboCtrl
|
UDP 通信端点。 更多...
#include <udp.h>
类 | |
| struct | info_type |
| UDP 初始化参数。 更多... | |
Public 成员函数 | |
| udp (info_type info) | |
| 构造并连接到指定远端。 | |
| awaitable< void > | send (byte_span data) |
| 异步发送一段字节数据。 | |
| awaitable< void > | task () |
| 接收循环任务。 | |
| std::string | desc () const |
Public 成员函数 继承自 roboctrl::io::bare_io_base | |
| void | on_data (callback_fn< byte_span > auto fn) |
| 注册字节级别的回调。 | |
| template<typename Fn > requires (!std::same_as<utils::function_arg_t<Fn>,byte_span>) | |
| void | on_data (Fn &&fn) |
| template<roboctrl::utils::package T> requires (!std::same_as<T, byte_span>) | |
| awaitable< void > | send (const T &data) |
| 发送平凡类型数据。 | |
Public 成员函数 继承自 roboctrl::utils::immovable_base | |
| immovable_base (immovable_base &&)=delete | |
| immovable_base & | operator= (immovable_base &&)=delete |
Public 成员函数 继承自 roboctrl::utils::not_copyable_base | |
| not_copyable_base (const not_copyable_base &)=delete | |
| not_copyable_base & | operator= (const not_copyable_base &)=delete |
额外继承的成员函数 | |
Protected 成员函数 继承自 roboctrl::io::bare_io_base | |
| void | dispatch (byte_span bytes) |
| 分发收到的字节流。 | |
| udp::udp | ( | info_type | info | ) |
构造并连接到指定远端。
引用了 roboctrl::async::executor(), roboctrl::async::spawn() , 以及 task().
| roboctrl::awaitable< void > udp::send | ( | byte_span | data | ) |
| roboctrl::awaitable< void > udp::task | ( | ) |