diff options
author | Jameson Nash <vtjnash@gmail.com> | 2020-11-09 21:50:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 21:50:09 -0500 |
commit | 4ddc292774be827a297449e2d5ef4047c85de7ca (patch) | |
tree | 7fedab232a10eaef494b6cdaf9c17d095667a762 /docs/src | |
parent | cbcd0cfc824c712f6068930507a34d6b80e33b29 (diff) | |
download | libuv-4ddc292774be827a297449e2d5ef4047c85de7ca.tar.gz libuv-4ddc292774be827a297449e2d5ef4047c85de7ca.zip |
stream: add uv_pipe and uv_socketpair to the API
Equivalents of `pipe` and `socketpair` for cross-platform use.
PR-URL: https://github.com/libuv/libuv/pull/2953
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/pipe.rst | 18 | ||||
-rw-r--r-- | docs/src/process.rst | 12 | ||||
-rw-r--r-- | docs/src/tcp.rst | 17 |
3 files changed, 42 insertions, 5 deletions
diff --git a/docs/src/pipe.rst b/docs/src/pipe.rst index 6437a9d9..ab488df8 100644 --- a/docs/src/pipe.rst +++ b/docs/src/pipe.rst @@ -118,3 +118,21 @@ API function is blocking. .. versionadded:: 1.16.0 + +.. c:function:: int uv_pipe(uv_file fds[2], int read_flags, int write_flags) + + Create a pair of connected pipe handles. + Data may be written to `fds[1]` and read from `fds[0]`. + The resulting handles can be passed to `uv_pipe_open`, used with `uv_spawn`, + or for any other purpose. + + Valid values for `flags` are: + + - UV_NONBLOCK_PIPE: Opens the specified socket handle for `OVERLAPPED` + or `FIONBIO`/`O_NONBLOCK` I/O usage. + This is recommended for handles that will be used by libuv, + and not usually recommended otherwise. + + Equivalent to :man:`pipe(2)` with the `O_CLOEXEC` flag set. + + .. versionadded:: 1.x.0 diff --git a/docs/src/process.rst b/docs/src/process.rst index 8ff19add..ea6c4b9a 100644 --- a/docs/src/process.rst +++ b/docs/src/process.rst @@ -119,12 +119,14 @@ Data types * flags may be specified to create a duplex data stream. */ UV_READABLE_PIPE = 0x10, - UV_WRITABLE_PIPE = 0x20 + UV_WRITABLE_PIPE = 0x20, /* - * Open the child pipe handle in overlapped mode on Windows. - * On Unix it is silently ignored. - */ - UV_OVERLAPPED_PIPE = 0x40 + * When UV_CREATE_PIPE is specified, specifying UV_NONBLOCK_PIPE opens the + * handle in non-blocking mode in the child. This may cause loss of data, + * if the child is not designed to handle to encounter this mode, + * but can also be significantly more efficient. + */ + UV_NONBLOCK_PIPE = 0x40 } uv_stdio_flags; diff --git a/docs/src/tcp.rst b/docs/src/tcp.rst index e85d0317..92f9087f 100644 --- a/docs/src/tcp.rst +++ b/docs/src/tcp.rst @@ -127,3 +127,20 @@ API :c:func:`uv_tcp_close_reset` calls is not allowed. .. versionadded:: 1.32.0 + +.. c:function:: int uv_socketpair(int type, int protocol, uv_os_sock_t socket_vector[2], int flags0, int flags1) + + Create a pair of connected sockets with the specified properties. + The resulting handles can be passed to `uv_tcp_open`, used with `uv_spawn`, + or for any other purpose. + + Valid values for `flags0` and `flags1` are: + + - UV_NONBLOCK_PIPE: Opens the specified socket handle for `OVERLAPPED` + or `FIONBIO`/`O_NONBLOCK` I/O usage. + This is recommended for handles that will be used by libuv, + and not usually recommended otherwise. + + Equivalent to :man:`socketpair(2)` with a domain of AF_UNIX. + + .. versionadded:: 1.x.0 |