Pipe
uv_pipe_t.Pipe
#include <icy/pipe.h>class PipeDefined in src/base/include/icy/pipe.h:27
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.
List of all members
| Name | Kind | Owner |
|---|---|---|
Pipe | function | Declared here |
~Pipe | function | Declared here |
init | function | Declared here |
readStart | function | Declared here |
Read | variable | Inherited from Stream |
Stream | function | Inherited from Stream |
~Stream | function | Inherited from Stream |
close | function | Inherited from Stream |
shutdown | function | Inherited from Stream |
write | function | Inherited from Stream |
writeOwned | function | Inherited from Stream |
setHighWaterMark | function | Inherited from Stream |
write | function | Inherited from Stream |
stream | function | Inherited from Stream |
_buffer | variable | Inherited from Stream |
_started | variable | Inherited from Stream |
_highWaterMark | variable | Inherited from Stream |
_writeReqFree | variable | Inherited from Stream |
_ownedWriteReqFree | variable | Inherited from Stream |
readStart | function | Inherited from Stream |
readStop | function | Inherited from Stream |
onRead | function | Inherited from Stream |
allocWriteReq | function | Inherited from Stream |
freeWriteReq | function | Inherited from Stream |
allocOwnedWriteReq | function | Inherited from Stream |
freeOwnedWriteReq | function | Inherited from Stream |
canQueueWrite | function | Inherited from Stream |
Handle | typedef | Inherited from Stream |
Handle | function | Inherited from Handle |
~Handle | function | Inherited from Handle |
init | function | Inherited from Handle |
invoke | function | Inherited from Handle |
invokeOrThrow | function | Inherited from Handle |
close | function | Inherited from Handle |
ref | function | Inherited from Handle |
unref | function | Inherited from Handle |
initialized | function | Inherited from Handle |
active | function | Inherited from Handle |
closing | function | Inherited from Handle |
closed | function | Inherited from Handle |
error | function | Inherited from Handle |
setError | function | Inherited from Handle |
setUVError | function | Inherited from Handle |
setAndThrowError | function | Inherited from Handle |
throwLastError | function | Inherited from Handle |
loop | function | Inherited from Handle |
reset | function | Inherited from Handle |
get | function | Inherited from Handle |
tid | function | Inherited from Handle |
context | function | Inherited from Handle |
setCloseCleanup | function | Inherited from Handle |
clearCloseCleanup | function | Inherited from Handle |
assertThread | function | Inherited from Handle |
_loop | variable | Inherited from Handle |
_context | variable | Inherited from Handle |
_tid | variable | Inherited from Handle |
_error | variable | Inherited from Handle |
onError | function | Inherited from Handle |
onClose | function | Inherited from Handle |
Handle | function | Inherited from Handle |
operator= | function | Inherited from Handle |
Handle | function | Inherited from Handle |
operator= | function | Inherited from Handle |
Type | typedef | Inherited from Handle |
Inherited from Stream
| Kind | Name | Description |
|---|---|---|
variable | Read | Emitted when data has been received from the peer. |
function | Stream inline | Construct the stream bound to loop with a 64 KiB read buffer. |
function | ~Stream virtual inline | Destroy the stream, stopping reads and freeing pooled write requests. |
function | close virtual inline override | Closes and resets the stream handle. This will close the active socket/pipe and destroy the handle. |
function | shutdown inline | Send a TCP/pipe shutdown request to the connected peer. |
function | write inline | Write len bytes from data to the stream. |
function | writeOwned inline | Write an owned payload buffer to the stream. |
function | setHighWaterMark inline | Set the high water mark for the write queue (default 16MB). When the write queue exceeds this size, write() returns false. |
function | write inline | Write len bytes from data together with a stream handle over an IPC pipe (uses uv_write2). |
function | stream inline | Return the underlying uv_stream_t pointer cast from the native handle. |
variable | _buffer | |
variable | _started | |
variable | _highWaterMark | 16MB default write queue limit |
variable | _writeReqFree | Freelist for write requests. |
variable | _ownedWriteReqFree | Freelist for owned write requests. |
function | readStart virtual inline | Begin reading from the stream by registering libuv read callbacks. |
function | readStop virtual inline | Stop reading from the stream. |
function | onRead virtual inline | Called by handleRead when len bytes of data arrive. |
function | allocWriteReq inline | Return a uv_write_t from the freelist, or allocate a new one if the pool is empty. |
function | freeWriteReq inline | Return req to the freelist, or delete it if the pool is at capacity. |
function | allocOwnedWriteReq inline | |
function | freeOwnedWriteReq inline | |
function | canQueueWrite inline | |
typedef | Handle |
Inherited from Handle
| Kind | Name | Description |
|---|---|---|
function | Handle inline | Construct the handle bound to the given event loop. |
function | ~Handle virtual inline | |
function | init inline | Initialize the underlying libuv handle by calling f with the loop, the raw handle pointer, and any additional args. |
function | invoke inline | Invoke a libuv function f with args on the initialized handle. |
function | invokeOrThrow inline | Invoke a libuv function f with args, throwing on failure. |
function | close virtual inline | Close and destroy the handle. |
function | ref inline | Re-reference the handle with the event loop after a previous [unref()](icy-uv-Handle.html#unref). |
function | unref inline | Unreference the handle from the event loop. |
function | initialized const inline | Return true if the handle has been successfully initialized via [init()](icy-uv-Handle.html#init-8). |
function | active virtual const inline | Return true when the handle is active (libuv uv_is_active). |
function | closing virtual const inline | Return true if uv_close has been called and the handle is awaiting its close callback (libuv uv_is_closing). |
function | closed virtual const inline | Return true if the handle has been fully closed (context released). |
function | error const inline | Return the last error set on this handle, or a default-constructed [Error](icy-Error.html#error) if no error has occurred. |
function | setError virtual inline | Set the error state and invoke [onError()](icy-uv-Handle.html#onerror). |
function | setUVError inline | Translate a libuv error code into an [Error](icy-Error.html#error) and call [setError()](icy-uv-Handle.html#seterror-1). |
function | setAndThrowError inline | Set the error state from a libuv error code and throw a std::runtime_error. |
function | throwLastError inline | Throw a std::runtime_error if the handle currently holds an error. |
function | loop const inline | Return the event loop this handle is bound to. |
function | reset inline | Close the current handle (if open) and allocate a fresh [Context](icy-uv-Context.html#context-2), leaving the handle ready to be re-initialized via [init()](icy-uv-Handle.html#init-8). |
function | get const inline | Return the raw libuv handle pointer cast to [Handle](icy-uv-Handle.html#handle-6). |
function | tid const inline | Return the ID of the thread that constructed this handle. |
function | context const inline | Return the raw [Context](icy-uv-Context.html#context-2) that owns the libuv handle memory. |
function | setCloseCleanup inline | |
function | clearCloseCleanup inline | |
function | assertThread const inline | Throw std::logic_error if called from any thread other than the thread that constructed this handle. |
variable | _loop | |
variable | _context | |
variable | _tid | |
variable | _error | |
function | onError virtual inline | Called by [setError()](icy-uv-Handle.html#seterror-1) after the error state has been updated. |
function | onClose virtual inline | Called by [close()](icy-uv-Handle.html#close-18) after the context has been released. |
function | Handle | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | Handle | Deleted constructor. |
function | operator= | Deleted assignment operator. |
typedef | Type | Define the native handle type. |
Public Methods
| Return | Name | Description |
|---|---|---|
Pipe | Construct a [Pipe](#pipe) bound to loop without initializing the libuv handle. | |
~Pipe virtual | Destroy the pipe, stopping reads and closing the handle. | |
void | init virtual | Initialize the underlying uv_pipe_t handle. |
bool | readStart virtual override | Start reading from the pipe. |
Pipe
Pipe(uv::Loop * loop = uv::defaultLoop())Defined in src/base/include/icy/pipe.h:35
Construct a [Pipe](#pipe) bound to loop without initializing the libuv handle.
Call [init()](#init-3) before performing any I/O.
Parameters
loopEvent loop to associate with. Defaults to the process-wide default loop.
~Pipe
virtual
virtual ~Pipe()Defined in src/base/include/icy/pipe.h:38
Destroy the pipe, stopping reads and closing the handle.
init
virtual
virtual void init(bool ipc = false)Defined in src/base/include/icy/pipe.h:46
Initialize the underlying uv_pipe_t handle.
Must be called before [readStart()](#readstart) or any write operations.
Parameters
ipcSet totrueto enable IPC mode, which allows sending and receiving stream handles alongside data via[write()](icy-Stream.html#write-16).
readStart
virtual override
virtual bool readStart() overrideDefined in src/base/include/icy/pipe.h:54
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.
