|
|
|
@ -142,6 +142,8 @@ static void send_ping_locked(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, |
|
|
|
|
grpc_chttp2_ping_type ping_type, |
|
|
|
|
grpc_closure *on_initiate, |
|
|
|
|
grpc_closure *on_complete); |
|
|
|
|
static void retry_initiate_ping_locked(grpc_exec_ctx *exec_ctx, void *tp, |
|
|
|
|
grpc_error *error); |
|
|
|
|
|
|
|
|
|
#define DEFAULT_MIN_TIME_BETWEEN_PINGS_MS 0 |
|
|
|
|
#define DEFAULT_MAX_PINGS_BETWEEN_DATA 3 |
|
|
|
@ -266,6 +268,8 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, |
|
|
|
|
grpc_closure_init(&t->destructive_reclaimer_locked, |
|
|
|
|
destructive_reclaimer_locked, t, |
|
|
|
|
grpc_combiner_scheduler(t->combiner, false)); |
|
|
|
|
grpc_closure_init(&t->retry_initiate_ping_locked, retry_initiate_ping_locked, |
|
|
|
|
t, grpc_combiner_scheduler(t->combiner, false)); |
|
|
|
|
grpc_closure_init(&t->start_bdp_ping_locked, start_bdp_ping_locked, t, |
|
|
|
|
grpc_combiner_scheduler(t->combiner, false)); |
|
|
|
|
grpc_closure_init(&t->finish_bdp_ping_locked, finish_bdp_ping_locked, t, |
|
|
|
@ -1388,6 +1392,12 @@ static void send_ping_locked(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void retry_initiate_ping_locked(grpc_exec_ctx *exec_ctx, void *tp, |
|
|
|
|
grpc_error *error) { |
|
|
|
|
grpc_chttp2_transport *t = tp; |
|
|
|
|
grpc_chttp2_initiate_write(exec_ctx, t, false, "retry_send_ping"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void grpc_chttp2_ack_ping(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, |
|
|
|
|
uint64_t id) { |
|
|
|
|
grpc_chttp2_ping_queue *pq = |
|
|
|
@ -2114,9 +2124,7 @@ static void finish_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg, |
|
|
|
|
grpc_timer_init( |
|
|
|
|
exec_ctx, &t->keepalive_ping_timer, |
|
|
|
|
gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), t->keepalive_time), |
|
|
|
|
grpc_closure_create(init_keepalive_ping_locked, t, |
|
|
|
|
grpc_combiner_scheduler(t->combiner, false)), |
|
|
|
|
gpr_now(GPR_CLOCK_MONOTONIC)); |
|
|
|
|
&t->init_keepalive_ping_locked, gpr_now(GPR_CLOCK_MONOTONIC)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
GRPC_CHTTP2_UNREF_TRANSPORT(exec_ctx, t, "keepalive ping end"); |
|
|
|
|