either be a Lua string or a table of strings. If a
table is passed in, the C backend will use writev to send all
strings in a single system call.
The optional `callback` is for knowing when the write is
complete.
Returns: `uv_write_t userdata` or `fail`
uv.write2({stream}, {data}, {send_handle} [, {callback}]) *uv.write2()*
> method form `stream:write2(data, send_handle, [callback])`
Parameters:
- `stream`: `userdata` for sub-type of |uv_stream_t|
- `data`: `buffer`
- `send_handle`: `userdata` for sub-type of |uv_stream_t|
- `callback`: `callable` or `nil`
- `err`: `nil` or `string`
Extended write function for sending handles over a pipe. The
pipe must be initialized with `ipc` option `true`.
Returns: `uv_write_t userdata` or `fail`
Note: `send_handle` must be a TCP socket or pipe, which is a
server or a connection (listening or connected state). Bound
sockets or pipes will be assumed to be servers.
uv.try_write({stream}, {data}) *uv.try_write()*
> method form `stream:try_write(data)`
Parameters:
- `stream`: `userdata` for sub-type of |uv_stream_t|
- `data`: `buffer`
Same as |uv.write()|, but won't queue a write request if it
can't be completed immediately.
Will return number of bytes written (can be less than the
supplied buffer size).
Returns: `integer` or `fail`
uv.try_write2({stream}, {data}, {send_handle}) *uv.try_write2()*
> method form `stream:try_write2(data, send_handle)`
Parameters:
- `stream`: `userdata` for sub-type of |uv_stream_t|
- `data`: `buffer`
- `send_handle`: `userdata` for sub-type of |uv_stream_t|
Like |uv.write2()|, but with the properties of
|uv.try_write()|. Not supported on Windows, where it returns
`UV_EAGAIN`.
Will return number of bytes written (can be less than the
supplied buffer size).
Returns: `integer` or `fail`
uv.is_readable({stream}) *uv.is_readable()*
> method form `stream:is_readable()`
Parameters:
- `stream`: `userdata` for sub-type of |uv_stream_t|
Returns `true` if the stream is readable, `false` otherwise.
Returns: `boolean`
uv.is_writable({stream}) *uv.is_writable()*
> method form `stream:is_writable()`
Parameters:
- `stream`: `userdata` for sub-type of |uv_stream_t|
Returns `true` if the stream is writable, `false` otherwise.
Returns: `boolean`
uv.stream_set_blocking({stream}, {blocking}) *uv.stream_set_blocking()*
> method form `stream:set_blocking(blocking)`
Parameters:
- `stream`: `userdata` for sub-type of |uv_stream_t|
- `blocking`: `boolean`
Enable or disable blocking mode for a stream.
When blocking mode is enabled all writes complete
synchronously. The interface remains unchanged otherwise, e.g.
completion or failure of the operation will still be reported
through a callback which is made asynchronously.
Returns: `0` or `fail`
WARNING: Relying too much on this API is not recommended. It
is likely to change significantly in the future. Currently