diff options
author | 2017-04-15 10:20:51 -0700 | |
---|---|---|
committer | 2017-04-15 10:20:51 -0700 | |
commit | e223a6a042b3123a2aee25ec0d3fe42ffd0c43e2 (patch) | |
tree | 041120a077b83bae9f461f8e62dac5b531babaa1 /test/core/fling/server.c | |
parent | c953b62d396d6168507520d837550f6b12d7e729 (diff) | |
parent | 644e05e79ba04fb0f424cbb8dffce6c3cd3913ec (diff) |
Merge branch 'master' into new_tsi
Diffstat (limited to 'test/core/fling/server.c')
-rw-r--r-- | test/core/fling/server.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/test/core/fling/server.c b/test/core/fling/server.c index 7ea54b1167..7edff3d132 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -185,6 +185,7 @@ int main(int argc, char **argv) { call_state *s; char *addr_buf = NULL; gpr_cmdline *cl; + grpc_completion_queue *shutdown_cq; int shutdown_started = 0; int shutdown_finished = 0; @@ -214,7 +215,7 @@ int main(int argc, char **argv) { } gpr_log(GPR_INFO, "creating server on: %s", addr); - cq = grpc_completion_queue_create(NULL); + cq = grpc_completion_queue_create_for_next(NULL); if (secure) { grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key, test_server1_cert}; @@ -242,10 +243,16 @@ int main(int argc, char **argv) { while (!shutdown_finished) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - grpc_server_shutdown_and_notify(server, cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck( - cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) - .type == GRPC_OP_COMPLETE); + + shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); + + GPR_ASSERT( + grpc_completion_queue_pluck(shutdown_cq, tag(1000), + grpc_timeout_seconds_to_deadline(5), NULL) + .type == GRPC_OP_COMPLETE); + grpc_completion_queue_destroy(shutdown_cq); + grpc_completion_queue_shutdown(cq); shutdown_started = 1; } |