Lines Matching refs:pipe

93 static void eof_timer_init(uv_pipe_t* pipe);
94 static void eof_timer_start(uv_pipe_t* pipe);
95 static void eof_timer_stop(uv_pipe_t* pipe);
97 static void eof_timer_destroy(uv_pipe_t* pipe);
120 handle->pipe.conn.ipc_remote_pid = 0; in uv_pipe_init()
121 handle->pipe.conn.ipc_data_frame.payload_remaining = 0; in uv_pipe_init()
122 uv__queue_init(&handle->pipe.conn.ipc_xfer_queue); in uv_pipe_init()
123 handle->pipe.conn.ipc_xfer_queue_length = 0; in uv_pipe_init()
125 handle->pipe.conn.non_overlapped_writes_tail = NULL; in uv_pipe_init()
135 handle->pipe.conn.eof_timer = NULL; in uv__pipe_connection_init()
197 static void close_pipe(uv_pipe_t* pipe) { in close_pipe() argument
198 assert(pipe->u.fd == -1 || pipe->u.fd > 2); in close_pipe()
199 if (pipe->u.fd == -1) in close_pipe()
200 CloseHandle(pipe->handle); in close_pipe()
202 _close(pipe->u.fd); in close_pipe()
204 pipe->u.fd = -1; in close_pipe()
205 pipe->handle = INVALID_HANDLE_VALUE; in close_pipe()
521 handle->pipe.conn.readfile_thread_handle = NULL; in uv__set_pipe_handle()
522 InitializeCriticalSection(&handle->pipe.conn.readfile_thread_lock); in uv__set_pipe_handle()
653 while (!uv__queue_empty(&handle->pipe.conn.ipc_xfer_queue)) { in uv__pipe_endgame()
657 q = uv__queue_head(&handle->pipe.conn.ipc_xfer_queue); in uv__pipe_endgame()
673 handle->pipe.conn.ipc_xfer_queue_length = 0; in uv__pipe_endgame()
682 DeleteCriticalSection(&handle->pipe.conn.readfile_thread_lock); in uv__pipe_endgame()
686 assert(handle->pipe.serv.accept_reqs); in uv__pipe_endgame()
687 uv__free(handle->pipe.serv.accept_reqs); in uv__pipe_endgame()
688 handle->pipe.serv.accept_reqs = NULL; in uv__pipe_endgame()
698 handle->pipe.serv.pending_instances = count; in uv_pipe_pending_instances()
751 handle->pipe.serv.pending_instances = default_pending_pipe_instances; in uv_pipe_bind2()
755 handle->pipe.serv.accept_reqs = (uv_pipe_accept_t*) in uv_pipe_bind2()
756 uv__malloc(sizeof(uv_pipe_accept_t) * handle->pipe.serv.pending_instances); in uv_pipe_bind2()
757 if (handle->pipe.serv.accept_reqs == NULL) { in uv_pipe_bind2()
761 for (i = 0; i < handle->pipe.serv.pending_instances; i++) { in uv_pipe_bind2()
762 req = &handle->pipe.serv.accept_reqs[i]; in uv_pipe_bind2()
784 &handle->pipe.serv.accept_reqs[0], in uv_pipe_bind2()
797 handle->pipe.serv.pending_accepts = NULL; in uv_pipe_bind2()
804 uv__free(handle->pipe.serv.accept_reqs); in uv_pipe_bind2()
807 handle->pipe.serv.accept_reqs = NULL; in uv_pipe_bind2()
1018 volatile HANDLE* thread_ptr = &handle->pipe.conn.readfile_thread_handle; in uv__pipe_interrupt_read()
1020 EnterCriticalSection(&handle->pipe.conn.readfile_thread_lock); in uv__pipe_interrupt_read()
1039 LeaveCriticalSection(&handle->pipe.conn.readfile_thread_lock); in uv__pipe_interrupt_read()
1082 for (i = 0; i < handle->pipe.serv.pending_instances; i++) { in uv__pipe_close()
1083 pipeHandle = handle->pipe.serv.accept_reqs[i].pipeHandle; in uv__pipe_close()
1086 handle->pipe.serv.accept_reqs[i].pipeHandle = INVALID_HANDLE_VALUE; in uv__pipe_close()
1152 if (uv__queue_empty(&server->pipe.conn.ipc_xfer_queue)) { in uv__pipe_accept()
1157 q = uv__queue_head(&server->pipe.conn.ipc_xfer_queue); in uv__pipe_accept()
1159 server->pipe.conn.ipc_xfer_queue_length--; in uv__pipe_accept()
1176 req = server->pipe.serv.pending_accepts; in uv__pipe_accept()
1188 server->pipe.serv.pending_accepts = req->next_pending; in uv__pipe_accept()
1232 assert(handle->pipe.serv.accept_reqs[0].pipeHandle != INVALID_HANDLE_VALUE); in uv__pipe_listen()
1234 for (i = 0; i < handle->pipe.serv.pending_instances; i++) { in uv__pipe_listen()
1235 uv__pipe_queue_accept(loop, handle, &handle->pipe.serv.accept_reqs[i], i == 0); in uv__pipe_listen()
1246 volatile HANDLE* thread_ptr = &handle->pipe.conn.readfile_thread_handle; in uv_pipe_zero_readfile_thread_proc()
1247 CRITICAL_SECTION* lock = &handle->pipe.conn.readfile_thread_lock; in uv_pipe_zero_readfile_thread_proc()
1391 handle->pipe.conn.readfile_thread_handle = NULL; /* Reset cancellation. */ in uv__pipe_queue_read()
1473 if (handle->pipe.conn.non_overlapped_writes_tail) { in uv__insert_non_overlapped_write_req()
1475 handle->pipe.conn.non_overlapped_writes_tail->next_req; in uv__insert_non_overlapped_write_req()
1476 handle->pipe.conn.non_overlapped_writes_tail->next_req = (uv_req_t*)req; in uv__insert_non_overlapped_write_req()
1477 handle->pipe.conn.non_overlapped_writes_tail = req; in uv__insert_non_overlapped_write_req()
1480 handle->pipe.conn.non_overlapped_writes_tail = req; in uv__insert_non_overlapped_write_req()
1488 if (handle->pipe.conn.non_overlapped_writes_tail) { in uv_remove_non_overlapped_write_req()
1489 req = (uv_write_t*)handle->pipe.conn.non_overlapped_writes_tail->next_req; in uv_remove_non_overlapped_write_req()
1491 if (req == handle->pipe.conn.non_overlapped_writes_tail) { in uv_remove_non_overlapped_write_req()
1492 handle->pipe.conn.non_overlapped_writes_tail = NULL; in uv_remove_non_overlapped_write_req()
1494 handle->pipe.conn.non_overlapped_writes_tail->next_req = in uv_remove_non_overlapped_write_req()
1730 DWORD* pid = &handle->pipe.conn.ipc_remote_pid; in uv__pipe_get_ipc_remote_pid()
1913 uv__queue_insert_tail(&handle->pipe.conn.ipc_xfer_queue, &item->member); in uv__pipe_queue_ipc_xfer_info()
1914 handle->pipe.conn.ipc_xfer_queue_length++; in uv__pipe_queue_ipc_xfer_info()
2035 data_remaining = &handle->pipe.conn.ipc_data_frame.payload_remaining; in uv__pipe_read_ipc()
2213 handle->pipe.conn.non_overlapped_writes_tail) { in uv__process_pipe_write_req()
2241 req->next_pending = handle->pipe.serv.pending_accepts; in uv__process_pipe_accept_req()
2242 handle->pipe.serv.pending_accepts = req; in uv__process_pipe_accept_req()
2336 static void eof_timer_init(uv_pipe_t* pipe) { in eof_timer_init() argument
2339 assert(pipe->pipe.conn.eof_timer == NULL); in eof_timer_init()
2340 assert(pipe->flags & UV_HANDLE_CONNECTION); in eof_timer_init()
2342 pipe->pipe.conn.eof_timer = (uv_timer_t*) uv__malloc(sizeof *pipe->pipe.conn.eof_timer); in eof_timer_init()
2344 r = uv_timer_init(pipe->loop, pipe->pipe.conn.eof_timer); in eof_timer_init()
2347 pipe->pipe.conn.eof_timer->data = pipe; in eof_timer_init()
2348 uv_unref((uv_handle_t*) pipe->pipe.conn.eof_timer); in eof_timer_init()
2352 static void eof_timer_start(uv_pipe_t* pipe) { in eof_timer_start() argument
2353 assert(pipe->flags & UV_HANDLE_CONNECTION); in eof_timer_start()
2355 if (pipe->pipe.conn.eof_timer != NULL) { in eof_timer_start()
2356 uv_timer_start(pipe->pipe.conn.eof_timer, eof_timer_cb, eof_timeout, 0); in eof_timer_start()
2361 static void eof_timer_stop(uv_pipe_t* pipe) { in eof_timer_stop() argument
2362 assert(pipe->flags & UV_HANDLE_CONNECTION); in eof_timer_stop()
2364 if (pipe->pipe.conn.eof_timer != NULL) { in eof_timer_stop()
2365 uv_timer_stop(pipe->pipe.conn.eof_timer); in eof_timer_stop()
2371 uv_pipe_t* pipe = (uv_pipe_t*) timer->data; in eof_timer_cb() local
2374 assert(pipe->type == UV_NAMED_PIPE); in eof_timer_cb()
2380 assert(pipe->flags & UV_HANDLE_READ_PENDING); in eof_timer_cb()
2386 if ((pipe->flags & UV_HANDLE_READ_PENDING) && in eof_timer_cb()
2387 HasOverlappedIoCompleted(&pipe->read_req.u.io.overlapped)) { in eof_timer_cb()
2392 close_pipe(pipe); in eof_timer_cb()
2396 uv_read_stop((uv_stream_t*) pipe); in eof_timer_cb()
2400 uv__pipe_read_eof(loop, pipe, uv_null_buf_); in eof_timer_cb()
2404 static void eof_timer_destroy(uv_pipe_t* pipe) { in eof_timer_destroy() argument
2405 assert(pipe->flags & UV_HANDLE_CONNECTION); in eof_timer_destroy()
2407 if (pipe->pipe.conn.eof_timer) { in eof_timer_destroy()
2408 uv_close((uv_handle_t*) pipe->pipe.conn.eof_timer, eof_timer_close_cb); in eof_timer_destroy()
2409 pipe->pipe.conn.eof_timer = NULL; in eof_timer_destroy()
2420 int uv_pipe_open(uv_pipe_t* pipe, uv_file file) { in uv_pipe_open() argument
2430 if (pipe->flags & UV_HANDLE_PIPESERVER) in uv_pipe_open()
2432 if (pipe->flags & UV_HANDLE_CONNECTION) in uv_pipe_open()
2435 uv__pipe_connection_init(pipe); in uv_pipe_open()
2468 if (pipe->ipc) { in uv_pipe_open()
2480 err = uv__set_pipe_handle(pipe->loop, in uv_pipe_open()
2481 pipe, in uv_pipe_open()
2491 if (pipe->ipc) { in uv_pipe_open()
2492 assert(!(pipe->flags & UV_HANDLE_NON_OVERLAPPED_PIPE)); in uv_pipe_open()
2493 GetNamedPipeClientProcessId(os_handle, &pipe->pipe.conn.ipc_remote_pid); in uv_pipe_open()
2494 if (pipe->pipe.conn.ipc_remote_pid == GetCurrentProcessId()) { in uv_pipe_open()
2495 GetNamedPipeServerProcessId(os_handle, &pipe->pipe.conn.ipc_remote_pid); in uv_pipe_open()
2497 assert(pipe->pipe.conn.ipc_remote_pid != (DWORD)(uv_pid_t) -1); in uv_pipe_open()
2600 return handle->pipe.conn.ipc_xfer_queue_length; in uv_pipe_pending_count()
2638 if (handle->pipe.conn.ipc_xfer_queue_length == 0) in uv_pipe_pending_type()