Lines Matching refs:sock
61 uv_os_sock_t sock; member
71 uv_os_sock_t sock; member
105 uv_os_sock_t sock; in create_bound_socket() local
108 sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP); in create_bound_socket()
110 ASSERT_NE(sock, INVALID_SOCKET); in create_bound_socket()
112 ASSERT_GE(sock, 0); in create_bound_socket()
119 r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes); in create_bound_socket()
124 r = bind(sock, (const struct sockaddr*) &bind_addr, sizeof bind_addr); in create_bound_socket()
127 return sock; in create_bound_socket()
131 static void close_socket(uv_os_sock_t sock) { in close_socket() argument
134 r = closesocket(sock); in close_socket()
136 r = close(sock); in close_socket()
146 uv_os_sock_t sock, int is_server_connection) { in create_connection_context() argument
153 context->sock = sock; in create_connection_context()
164 r = uv_poll_init_socket(uv_default_loop(), &context->poll_handle, sock); in create_connection_context()
228 r = recv(context->sock, buffer, sizeof buffer, 0);
250 r = recv(context->sock, buffer, sizeof buffer, 0);
313 r = send(context->sock, buffer, send_bytes, 0);
337 r = send(context->sock, buffer, send_bytes, 0);
355 r = send(context->sock, buffer, send_bytes, 0);
403 r = shutdown(context->sock, SD_SEND);
405 r = shutdown(context->sock, SHUT_WR);
424 close_socket(context->sock);
463 uv_os_sock_t sock) { argument
470 context->sock = sock;
473 r = uv_poll_init_socket(uv_default_loop(), &context->poll_handle, sock);
498 uv_os_sock_t sock; local
502 sock = accept(server_context->sock, (struct sockaddr*) &addr, &addr_len);
504 ASSERT_NE(sock, INVALID_SOCKET);
506 ASSERT_GE(sock, 0);
509 connection_context = create_connection_context(sock, 1);
517 close_socket(server_context->sock);
526 uv_os_sock_t sock; local
530 sock = create_bound_socket(addr);
531 context = create_server_context(sock);
533 r = listen(sock, 100);
542 uv_os_sock_t sock; local
551 sock = create_bound_socket(addr);
552 context = create_connection_context(sock, 0);
560 r = connect(sock, (struct sockaddr*) &server_addr, sizeof server_addr);