|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
命名管道类 更多...
#include <pipe.hpp>
Public 成员函数 | |
| named_pipe () | |
| 默认构造函数 | |
| ~named_pipe () | |
| 析构函数 | |
| named_pipe (named_pipe &&other) noexcept | |
| 移动构造函数 | |
| named_pipe & | operator= (named_pipe &&other) noexcept |
| 移动赋值运算符 | |
| bool | create (const string &name, bool nonblocking=false) |
| 创建命名管道服务端 | |
| bool | connect (const string &name, int timeout_ms=-1) |
| 连接到已存在的命名管道(客户端) | |
| bool | wait_for_client () |
| 等待客户端连接(服务端) | |
| int | read (void *buffer, size_t size) noexcept |
| 从管道读取数据 | |
| int | write (const void *data, size_t size) noexcept |
| 向管道写入数据 | |
| void | close () noexcept |
| 关闭管道 | |
| bool | is_valid () const noexcept |
| 检查管道是否有效 | |
| bool | set_nonblocking (bool v) noexcept |
| 设置非阻塞模式 | |
| bool | is_nonblocking () const noexcept |
| 查询是否非阻塞 | |
| const string & | name () const noexcept |
| 获取管道名称 | |
| native_handle_type | native_handle () const noexcept |
| 获取原生句柄 | |
静态 Public 成员函数 | |
| static bool | remove (const string &path) |
| 删除命名管道(仅 Linux FIFO) | |
| bool neforce::named_pipe::connect | ( | const string & | name, |
| int | timeout_ms = -1 ) |
连接到已存在的命名管道(客户端)
| name | 管道名称 |
| timeout_ms | 连接超时毫秒(仅 Windows),-1 表示无限等待 |
| pipe_exception | 连接失败时抛出 |
引用了 name().
| bool neforce::named_pipe::create | ( | const string & | name, |
| bool | nonblocking = false ) |
|
inlinenodiscardnoexcept |
|
nodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
noexcept |
|
static |
删除命名管道(仅 Linux FIFO)
| path | FIFO 文件路径 |
|
noexcept |
| bool neforce::named_pipe::wait_for_client | ( | ) |
|
noexcept |