Lines Matching refs:tcp

164   handle->tcp.serv.accept_reqs = NULL;  in uv_tcp_init_ex()
165 handle->tcp.serv.pending_accepts = NULL; in uv_tcp_init_ex()
168 handle->tcp.serv.func_acceptex = NULL; in uv_tcp_init_ex()
169 handle->tcp.conn.func_connectex = NULL; in uv_tcp_init_ex()
170 handle->tcp.serv.processed_accepts = 0; in uv_tcp_init_ex()
242 if (!(handle->flags & UV_HANDLE_CONNECTION) && handle->tcp.serv.accept_reqs) { in uv__tcp_endgame()
245 req = &handle->tcp.serv.accept_reqs[i]; in uv__tcp_endgame()
257 uv__free(handle->tcp.serv.accept_reqs); in uv__tcp_endgame()
258 handle->tcp.serv.accept_reqs = NULL; in uv__tcp_endgame()
435 success = handle->tcp.serv.func_acceptex(handle->socket, in uv__tcp_queue_accept()
579 if (!handle->tcp.serv.func_acceptex) { in uv__tcp_listen()
580 if (!uv__get_acceptex_function(handle->socket, &handle->tcp.serv.func_acceptex)) { in uv__tcp_listen()
598 if (handle->tcp.serv.accept_reqs == NULL) { in uv__tcp_listen()
599 handle->tcp.serv.accept_reqs = in uv__tcp_listen()
601 if (!handle->tcp.serv.accept_reqs) { in uv__tcp_listen()
606 req = &handle->tcp.serv.accept_reqs[i]; in uv__tcp_listen()
628 req = &handle->tcp.serv.accept_reqs[i]; in uv__tcp_listen()
645 uv_tcp_accept_t* req = server->tcp.serv.pending_accepts; in uv__tcp_accept()
676 server->tcp.serv.pending_accepts = req->next_pending; in uv__tcp_accept()
688 server->tcp.serv.processed_accepts++; in uv__tcp_accept()
690 if (server->tcp.serv.processed_accepts >= uv_simultaneous_server_accepts) { in uv__tcp_accept()
691 server->tcp.serv.processed_accepts = 0; in uv__tcp_accept()
696 uv__tcp_queue_accept(server, &server->tcp.serv.accept_reqs[0]); in uv__tcp_accept()
802 if (!handle->tcp.conn.func_connectex) { in uv__tcp_try_connect()
803 if (!uv__get_connectex_function(handle->socket, &handle->tcp.conn.func_connectex)) { in uv__tcp_try_connect()
842 success = handle->tcp.conn.func_connectex(handle->socket, in uv__tcp_try_connect()
999 uv_buf_init(NULL, 0) : handle->tcp.conn.read_buffer; in uv__process_tcp_read_req()
1021 &handle->tcp.conn.read_buffer); in uv__process_tcp_read_req()
1023 if (req->u.io.overlapped.InternalHigh < handle->tcp.conn.read_buffer.len) { in uv__process_tcp_read_req()
1035 handle->read_cb((uv_stream_t*)handle, UV_EOF, &handle->tcp.conn.read_buffer); in uv__process_tcp_read_req()
1184 req->next_pending = handle->tcp.serv.pending_accepts; in uv__process_tcp_accept_req()
1185 handle->tcp.serv.pending_accepts = req; in uv__process_tcp_accept_req()
1280 int uv__tcp_xfer_import(uv_tcp_t* tcp, in uv__tcp_xfer_import() argument
1301 tcp->loop, tcp, socket, xfer_info->socket_info.iAddressFamily, 1); in uv__tcp_xfer_import()
1307 tcp->delayed_error = xfer_info->delayed_error; in uv__tcp_xfer_import()
1308 tcp->flags |= UV_HANDLE_BOUND | UV_HANDLE_SHARED_TCP_SOCKET; in uv__tcp_xfer_import()
1311 uv__connection_init((uv_stream_t*)tcp); in uv__tcp_xfer_import()
1312 tcp->flags |= UV_HANDLE_READABLE | UV_HANDLE_WRITABLE; in uv__tcp_xfer_import()
1391 static void uv__tcp_try_cancel_reqs(uv_tcp_t* tcp) { in uv__tcp_try_cancel_reqs() argument
1397 socket = tcp->socket; in uv__tcp_try_cancel_reqs()
1398 reading = tcp->flags & UV_HANDLE_READ_PENDING; in uv__tcp_try_cancel_reqs()
1399 writing = tcp->stream.conn.write_reqs_pending > 0; in uv__tcp_try_cancel_reqs()
1406 CancelIoEx((HANDLE) socket, &tcp->read_req.u.io.overlapped); in uv__tcp_try_cancel_reqs()
1411 non_ifs_lsp = (tcp->flags & UV_HANDLE_IPV6) ? uv_tcp_non_ifs_lsp_ipv6 : in uv__tcp_try_cancel_reqs()
1434 if (socket != tcp->socket) { in uv__tcp_try_cancel_reqs()
1436 CancelIoEx((HANDLE) socket, &tcp->read_req.u.io.overlapped); in uv__tcp_try_cancel_reqs()
1443 void uv__tcp_close(uv_loop_t* loop, uv_tcp_t* tcp) { in uv__tcp_close() argument
1444 if (tcp->flags & UV_HANDLE_CONNECTION) { in uv__tcp_close()
1445 if (tcp->flags & UV_HANDLE_READING) { in uv__tcp_close()
1446 uv_read_stop((uv_stream_t*) tcp); in uv__tcp_close()
1448 uv__tcp_try_cancel_reqs(tcp); in uv__tcp_close()
1450 if (tcp->tcp.serv.accept_reqs != NULL) { in uv__tcp_close()
1455 uv_tcp_accept_t* req = &tcp->tcp.serv.accept_reqs[i]; in uv__tcp_close()
1462 assert(!(tcp->flags & UV_HANDLE_READING)); in uv__tcp_close()
1465 if (tcp->flags & UV_HANDLE_LISTENING) { in uv__tcp_close()
1466 tcp->flags &= ~UV_HANDLE_LISTENING; in uv__tcp_close()
1467 DECREASE_ACTIVE_COUNT(loop, tcp); in uv__tcp_close()
1470 tcp->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE); in uv__tcp_close()
1471 uv__handle_closing(tcp); in uv__tcp_close()
1478 if (!(tcp->flags & UV_HANDLE_CONNECTION) || in uv__tcp_close()
1479 tcp->stream.conn.write_reqs_pending == 0) { in uv__tcp_close()
1480 closesocket(tcp->socket); in uv__tcp_close()
1481 tcp->socket = INVALID_SOCKET; in uv__tcp_close()
1484 if (tcp->reqs_pending == 0) in uv__tcp_close()
1485 uv__want_endgame(loop, (uv_handle_t*) tcp); in uv__tcp_close()