|
|
|
@ -189,8 +189,7 @@ static void close_cb(uv_handle_t *handle) { gpr_free(handle); } |
|
|
|
|
|
|
|
|
|
static void tcp_connect(grpc_exec_ctx *exec_ctx, const struct sockaddr *remote, |
|
|
|
|
socklen_t remote_len, on_connect_result *result) { |
|
|
|
|
grpc_millis deadline = |
|
|
|
|
grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10)); |
|
|
|
|
gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10); |
|
|
|
|
uv_tcp_t *client_handle = gpr_malloc(sizeof(uv_tcp_t)); |
|
|
|
|
uv_connect_t *req = gpr_malloc(sizeof(uv_connect_t)); |
|
|
|
|
int nconnects_before; |
|
|
|
@ -207,7 +206,8 @@ static void tcp_connect(grpc_exec_ctx *exec_ctx, const struct sockaddr *remote, |
|
|
|
|
grpc_pollset_worker *worker = NULL; |
|
|
|
|
GPR_ASSERT(GRPC_LOG_IF_ERROR( |
|
|
|
|
"pollset_work", |
|
|
|
|
grpc_pollset_work(exec_ctx, g_pollset, &worker, deadline))); |
|
|
|
|
grpc_pollset_work(exec_ctx, g_pollset, &worker, |
|
|
|
|
grpc_timespec_to_millis_round_up(deadline)))); |
|
|
|
|
gpr_mu_unlock(g_mu); |
|
|
|
|
grpc_exec_ctx_finish(exec_ctx); |
|
|
|
|
gpr_mu_lock(g_mu); |
|
|
|
@ -246,7 +246,7 @@ static void test_connect(unsigned n) { |
|
|
|
|
GPR_ASSERT(GRPC_ERROR_NONE == |
|
|
|
|
grpc_tcp_server_add_port(s, &resolved_addr, &svr_port)); |
|
|
|
|
GPR_ASSERT(svr_port > 0); |
|
|
|
|
GPR_ASSERT(uv_ip6_addr("::", svr_port, (struct sockaddr_in6 *)addr) == 0); |
|
|
|
|
GPR_ASSERT((uv_ip6_addr("::", svr_port, (struct sockaddr_in6 *)addr)) == 0); |
|
|
|
|
/* Cannot use wildcard (port==0), because add_port() will try to reuse the
|
|
|
|
|
same port as a previous add_port(). */ |
|
|
|
|
svr1_port = grpc_pick_unused_port_or_die(); |
|
|
|
|