Base module

Pipe

Named pipe / stdio stream built on uv_pipe_t.

Pipe

#include <icy/pipe.h>

Inherits: Stream< uv_pipe_t >

Named pipe / stdio stream built on uv_pipe_t.

Suitable for inter-process communication and for wrapping process stdio (stdin/stdout/stderr). IPC mode allows passing stream handles between processes over the pipe.

Public Methods

ReturnNameDescription
PipeConstruct a [Pipe](#pipe) bound to loop without initializing the libuv handle.
~Pipe virtualDestroy the pipe, stopping reads and closing the handle.
voidinit virtualInitialize the underlying uv_pipe_t handle.
boolreadStart virtualStart reading from the pipe.

Pipe

Pipe(uv::Loop * loop)

Construct a [Pipe](#pipe) bound to loop without initializing the libuv handle.

Call [init()](#init-3) before performing any I/O.

Parameters

  • loop Event loop to associate with. Defaults to the process-wide default loop.

~Pipe

virtual

virtual ~Pipe()

Destroy the pipe, stopping reads and closing the handle.


init

virtual

virtual void init(bool ipc)

Initialize the underlying uv_pipe_t handle.

Must be called before [readStart()](#readstart) or any write operations.

Parameters

  • ipc Set to true to enable IPC mode, which allows sending and receiving stream handles alongside data via [write()](icy-Stream.html#write-16).

readStart

virtual

virtual bool readStart()

Start reading from the pipe.

Delegates to [Stream](icy-Stream.html#stream)<uv_pipe_t>::[readStart()](#readstart). Emits the Read signal as data arrives.

Returns

true if uv_read_start was called successfully.