Exemplo n.º 1
0
Arquivo: req.c Projeto: DagohtX/node
void uv_process_reqs() {
  uv_req_t* req;

  while (req = uv_remove_pending_req()) {
    switch (req->type) {
      case UV_READ:
        DELEGATE_STREAM_REQ(req, read, data);
        break;

      case UV_WRITE:
        DELEGATE_STREAM_REQ((uv_write_t*) req, write, handle);
        break;

      case UV_ACCEPT:
        DELEGATE_STREAM_REQ(req, accept, data);
        break;

      case UV_CONNECT:
        DELEGATE_STREAM_REQ((uv_connect_t*) req, connect, handle);
        break;

      case UV_SHUTDOWN:
        /* Tcp shutdown requests don't come here. */
        assert(((uv_shutdown_t*) req)->handle->type == UV_NAMED_PIPE);
        uv_process_pipe_shutdown_req(
            (uv_pipe_t*) ((uv_shutdown_t*) req)->handle, req);
        break;

      case UV_WAKEUP:
        uv_process_async_wakeup_req((uv_async_t*) req->data, req);
        break;

      case UV_ARES_EVENT_REQ:
        uv_process_ares_event_req((uv_ares_action_t*) req->data, req);
        break;

      case UV_ARES_CLEANUP_REQ:
        uv_process_ares_cleanup_req((uv_ares_task_t*) req->data, req);
        break;

      case UV_GETADDRINFO_REQ:
        uv_process_getaddrinfo_req((uv_getaddrinfo_t*) req->data, req);
        break;

      case UV_PROCESS_EXIT:
        uv_process_proc_exit((uv_process_t*) req->data);
        break;

      case UV_PROCESS_CLOSE:
        uv_process_proc_close((uv_process_t*) req->data);
        break;

      default:
        assert(0);
    }
  }
}
Exemplo n.º 2
0
Arquivo: req.c Projeto: DrPizza/libuv
void uv_process_reqs() {
  uv_req_t* req;

  while (req = uv_remove_pending_req()) {
    switch (req->type) {
      case UV_READ:
        DELEGATE_STREAM_REQ((uv_read_t*) req, read);
        break;

      case UV_WRITE:
        DELEGATE_STREAM_REQ((uv_write_t*) req, write);
        break;

      case UV_ACCEPT:
        DELEGATE_NETWORK_STREAM_REQ((uv_accept_t*) req, accept);
        break;

      case UV_CONNECT:
        DELEGATE_NETWORK_STREAM_REQ((uv_connect_t*) req, connect);
        break;

      case UV_WAKEUP:
        uv_process_async_wakeup_req((uv_async_t*) ((uv_wakeup_req_t*)req)->handle, (uv_wakeup_req_t*)req);
        break;

      case UV_ARES_EVENT_REQ:
        uv_process_ares_event_req((uv_ares_action_t*) ((uv_ares_action_req_t*)req)->handle, (uv_ares_action_req_t*)req);
        break;

      case UV_ARES_CLEANUP_REQ:
        uv_process_ares_cleanup_req((uv_ares_task_t*) ((uv_ares_task_req_t*)req)->handle, (uv_ares_task_req_t*)req);
        break;

      case UV_GETADDRINFO_REQ:
        uv_process_getaddrinfo_req((uv_getaddrinfo_t*) ((uv_getaddrinfo_req_t*)req)->handle, (uv_getaddrinfo_req_t*)req);
        break;

      case UV_PROCESS_EXIT:
        uv_process_proc_exit((uv_process_t*) req->handle);
        break;

      case UV_PROCESS_CLOSE:
        uv_process_proc_close((uv_process_t*) req->handle);
        break;

      default:
        assert(0);
    }
  }
}