pipe
简介
管道封装接口,用于创建管道对象实例
组件接口
pipe.gs
| 函数原型 | 函数作用 |
|---|---|
| read_pipe host_to_read(string name) | 使用指定的名字打开(创建)一个读管道。阻塞直到对端(通过 connect_to_write)链接 |
| read_pipe connect_to_read(string name) | 使用指定的名字连接到一个读管道。要链接的管道对端必须事先创建。 |
| write_pipe host_to_write(string name) | 使用指定的名字打开(创建)一个写管道。阻塞直到对端(通过 connect_to_read)链接 |
| write_pipe connect_to_write(string name) | 使用指定的名字连接到一个写管道。要链接的管道对端必须事先创建。 |
read_pipe.gs
读管道对象,能够通过 read 接口从管道读取数据
| 函数原型 | 函数作用 |
|---|---|
| buffer read(int max_read_sz = 16384) | 从对端读取数据,最多一次性读取 max_read_sz 个字节的数据 |
write_pipe.gs
写管道对象,能够通 过 write 接口向管道发送数据
| 函数原型 | 函数作用 |
|---|---|
| void write(buffer sending_buffer) | 向对端发送数据,阻塞直到数据完全发送 |