Lines Matching refs:handle
70 int uv__read_start(uv_stream_t* handle, in uv__read_start() argument
76 switch (handle->type) { in uv__read_start()
78 err = uv__tcp_read_start((uv_tcp_t*)handle, alloc_cb, read_cb); in uv__read_start()
81 err = uv__pipe_read_start((uv_pipe_t*)handle, alloc_cb, read_cb); in uv__read_start()
84 err = uv__tty_read_start((uv_tty_t*) handle, alloc_cb, read_cb); in uv__read_start()
94 int uv_read_stop(uv_stream_t* handle) { in uv_read_stop() argument
97 if (!(handle->flags & UV_HANDLE_READING)) in uv_read_stop()
101 if (handle->type == UV_TTY) { in uv_read_stop()
102 err = uv__tty_read_stop((uv_tty_t*) handle); in uv_read_stop()
103 } else if (handle->type == UV_NAMED_PIPE) { in uv_read_stop()
104 uv__pipe_read_stop((uv_pipe_t*) handle); in uv_read_stop()
106 handle->flags &= ~UV_HANDLE_READING; in uv_read_stop()
107 DECREASE_ACTIVE_COUNT(handle->loop, handle); in uv_read_stop()
115 uv_stream_t* handle, in uv_write() argument
119 uv_loop_t* loop = handle->loop; in uv_write()
122 if (!(handle->flags & UV_HANDLE_WRITABLE)) { in uv_write()
127 switch (handle->type) { in uv_write()
129 err = uv__tcp_write(loop, req, (uv_tcp_t*) handle, bufs, nbufs, cb); in uv_write()
133 loop, req, (uv_pipe_t*) handle, bufs, nbufs, NULL, cb); in uv_write()
136 err = uv__tty_write(loop, req, (uv_tty_t*) handle, bufs, nbufs, cb); in uv_write()
147 uv_stream_t* handle, in uv_write2() argument
152 uv_loop_t* loop = handle->loop; in uv_write2()
156 return uv_write(req, handle, bufs, nbufs, cb); in uv_write2()
159 if (handle->type != UV_NAMED_PIPE || !((uv_pipe_t*) handle)->ipc) { in uv_write2()
161 } else if (!(handle->flags & UV_HANDLE_WRITABLE)) { in uv_write2()
166 loop, req, (uv_pipe_t*) handle, bufs, nbufs, send_handle, cb); in uv_write2()
203 int uv_shutdown(uv_shutdown_t* req, uv_stream_t* handle, uv_shutdown_cb cb) { in uv_shutdown() argument
204 uv_loop_t* loop = handle->loop; in uv_shutdown()
206 if (!(handle->flags & UV_HANDLE_WRITABLE) || in uv_shutdown()
207 uv__is_stream_shutting(handle) || in uv_shutdown()
208 uv__is_closing(handle)) { in uv_shutdown()
213 req->handle = handle; in uv_shutdown()
216 handle->flags &= ~UV_HANDLE_WRITABLE; in uv_shutdown()
217 handle->stream.conn.shutdown_req = req; in uv_shutdown()
218 handle->reqs_pending++; in uv_shutdown()
219 REGISTER_HANDLE_REQ(loop, handle); in uv_shutdown()
221 if (handle->stream.conn.write_reqs_pending == 0) { in uv_shutdown()
222 if (handle->type == UV_NAMED_PIPE) in uv_shutdown()
223 uv__pipe_shutdown(loop, (uv_pipe_t*) handle, req); in uv_shutdown()
232 int uv_is_readable(const uv_stream_t* handle) { in uv_is_readable() argument
233 return !!(handle->flags & UV_HANDLE_READABLE); in uv_is_readable()
237 int uv_is_writable(const uv_stream_t* handle) { in uv_is_writable() argument
238 return !!(handle->flags & UV_HANDLE_WRITABLE); in uv_is_writable()
242 int uv_stream_set_blocking(uv_stream_t* handle, int blocking) { in uv_stream_set_blocking() argument
243 if (handle->type != UV_NAMED_PIPE) in uv_stream_set_blocking()
247 handle->flags |= UV_HANDLE_BLOCKING_WRITES; in uv_stream_set_blocking()
249 handle->flags &= ~UV_HANDLE_BLOCKING_WRITES; in uv_stream_set_blocking()