Merge pull request #15556 from kpayson64/fix_uv_connect_bug

Init connect timer before calling connect
pull/15614/head
kpayson64 7 years ago committed by GitHub
commit 122f9f6a31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/core/lib/iomgr/tcp_client_custom.cc

@ -140,12 +140,12 @@ static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
socket, connect->addr_name); socket, connect->addr_name);
} }
grpc_custom_socket_vtable->connect(
socket, (const grpc_sockaddr*)resolved_addr->addr, resolved_addr->len,
custom_connect_callback);
GRPC_CLOSURE_INIT(&connect->on_alarm, on_alarm, socket, GRPC_CLOSURE_INIT(&connect->on_alarm, on_alarm, socket,
grpc_schedule_on_exec_ctx); grpc_schedule_on_exec_ctx);
grpc_timer_init(&connect->alarm, deadline, &connect->on_alarm); grpc_timer_init(&connect->alarm, deadline, &connect->on_alarm);
grpc_custom_socket_vtable->connect(
socket, (const grpc_sockaddr*)resolved_addr->addr, resolved_addr->len,
custom_connect_callback);
} }
grpc_tcp_client_vtable custom_tcp_client_vtable = {tcp_connect}; grpc_tcp_client_vtable custom_tcp_client_vtable = {tcp_connect};

Loading…
Cancel
Save