Lines Matching defs:handle
234 static void uv__stream_osx_select_cb(uv_async_t* handle) {
239 s = container_of(handle, uv__stream_select_t, async);
551 /* TODO handle error */
676 assert(req->handle->write_queue_size >= size);
714 uv_stream_t* stream = req->handle;
739 static int uv__handle_fd(uv_handle_t* handle) {
740 switch (handle->type) {
743 return ((uv_stream_t*) handle)->io_watcher.fd;
746 return ((uv_udp_t*) handle)->io_watcher.fd;
859 assert(req->handle == stream);
866 /* Ensure the handle isn't sent again in case this is a partial write. */
1049 /* User indicates it can't or won't handle the read. */
1172 req->handle = stream;
1312 * OS X specific fields. On other Unices it does (handle)->io_watcher.fd,
1345 * a write() syscall when we know that the handle is in error mode.
1352 req->handle = stream;
1401 uv_stream_t* handle,
1405 return uv_write2(req, handle, bufs, nbufs, NULL, cb);
1486 int uv___stream_fd(const uv_stream_t* handle) {
1489 assert(handle->type == UV_TCP ||
1490 handle->type == UV_TTY ||
1491 handle->type == UV_NAMED_PIPE);
1493 s = handle->select;
1497 return handle->io_watcher.fd;
1502 void uv__stream_close(uv_stream_t* handle) {
1508 if (handle->select != NULL) {
1511 s = handle->select;
1515 uv__stream_osx_interrupt_select(handle);
1523 handle->select = NULL;
1527 uv__io_close(handle->loop, &handle->io_watcher);
1528 uv_read_stop(handle);
1529 uv__handle_stop(handle);
1530 handle->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
1532 if (handle->io_watcher.fd != -1) {
1534 if (handle->io_watcher.fd > STDERR_FILENO)
1535 uv__close(handle->io_watcher.fd);
1536 handle->io_watcher.fd = -1;
1539 if (handle->accepted_fd != -1) {
1540 uv__close(handle->accepted_fd);
1541 handle->accepted_fd = -1;
1545 if (handle->queued_fds != NULL) {
1546 queued_fds = handle->queued_fds;
1549 uv__free(handle->queued_fds);
1550 handle->queued_fds = NULL;
1553 assert(!uv__io_active(&handle->io_watcher, POLLIN | POLLOUT));
1557 int uv_stream_set_blocking(uv_stream_t* handle, int blocking) {
1561 return uv__nonblock(uv__stream_fd(handle), !blocking);