diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2015-01-13 17:33:50 +0100 |
---|---|---|
committer | Saúl Ibarra Corretgé <saghul@gmail.com> | 2015-01-14 19:46:54 +0100 |
commit | 393c1c59a27591d705648919b2d7fb921cba37bc (patch) | |
tree | 088041821bed28fb684c5174f91eb97b9f437831 /docs/src | |
parent | bb5f5d107e2feec31393e423698999d70d9a2285 (diff) | |
download | libuv-393c1c59a27591d705648919b2d7fb921cba37bc.tar.gz libuv-393c1c59a27591d705648919b2d7fb921cba37bc.zip |
unix: set non-block mode in uv_{pipe,tcp,udp}_open
The contract specifies that the file descriptor should already be in
non-blocking mode before passing it to libuv.
However, node users don't really have an opportunity to do so, never
mind the fact that the call to uv_pipe_open() or uv_tcp_open() is an
implementation detail that most users won't be aware of.
Let's be nice and set the non-blocking flag explicitly. It's a cheap
operation anyway.
Fixes: https://github.com/libuv/libuv/issues/124
PR: https://github.com/libuv/libuv/pull/134
Reviewed-by: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/pipe.rst | 3 | ||||
-rw-r--r-- | docs/src/tcp.rst | 4 | ||||
-rw-r--r-- | docs/src/udp.rst | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/docs/src/pipe.rst b/docs/src/pipe.rst index 614bb2e3..9fbb1f6c 100644 --- a/docs/src/pipe.rst +++ b/docs/src/pipe.rst @@ -38,8 +38,7 @@ API Open an existing file descriptor or HANDLE as a pipe. - .. note:: - The user is responsible for setting the file descriptor in non-blocking mode. + .. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode. .. c:function:: int uv_pipe_bind(uv_pipe_t* handle, const char* name) diff --git a/docs/src/tcp.rst b/docs/src/tcp.rst index 2c1001b5..8baedde8 100644 --- a/docs/src/tcp.rst +++ b/docs/src/tcp.rst @@ -36,9 +36,7 @@ API Open an existing file descriptor or SOCKET as a TCP handle. - .. note:: - The user is responsible for setting the file descriptor in - non-blocking mode. + .. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode. .. c:function:: int uv_tcp_nodelay(uv_tcp_t* handle, int enable) diff --git a/docs/src/udp.rst b/docs/src/udp.rst index 175ce07a..9c4aa210 100644 --- a/docs/src/udp.rst +++ b/docs/src/udp.rst @@ -120,6 +120,8 @@ API In other words, other datagram-type sockets like raw sockets or netlink sockets can also be passed to this function. + .. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode. + .. c:function:: int uv_udp_bind(uv_udp_t* handle, const struct sockaddr* addr, unsigned int flags) Bind the UDP handle to an IP address and port. |