diff options
author | 2016-05-18 23:04:11 -0700 | |
---|---|---|
committer | 2016-05-18 23:04:11 -0700 | |
commit | 147a9f2ead25916a84c1145d1b250992e76463be (patch) | |
tree | 3a3149a38625e090d70c626186d7803f9bce064a /test/core/util/test_tcp_server.c | |
parent | 9766f4f42482155c5442bd5e3c065ec68caa7a1f (diff) | |
parent | ef96264d8724a71f4f1fef5ebaf361d28b1a1752 (diff) |
Merge branch 'reuse_port' into reuse_affinity
Diffstat (limited to 'test/core/util/test_tcp_server.c')
-rw-r--r-- | test/core/util/test_tcp_server.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/test/core/util/test_tcp_server.c b/test/core/util/test_tcp_server.c index e39a95712c..27c16fc764 100644 --- a/test/core/util/test_tcp_server.c +++ b/test/core/util/test_tcp_server.c @@ -46,7 +46,7 @@ #include "test/core/util/port.h" static void on_server_destroyed(grpc_exec_ctx *exec_ctx, void *data, - bool success) { + grpc_error *error) { test_tcp_server *server = data; server->shutdown = 1; } @@ -72,9 +72,12 @@ void test_tcp_server_start(test_tcp_server *server, int port) { addr.sin_port = htons((uint16_t)port); memset(&addr.sin_addr, 0, sizeof(addr.sin_addr)); - server->tcp_server = grpc_tcp_server_create(&server->shutdown_complete); - port_added = - grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr)); + grpc_error *error = + grpc_tcp_server_create(&server->shutdown_complete, &server->tcp_server); + GPR_ASSERT(error == GRPC_ERROR_NONE); + error = grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr), + &port_added); + GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(port_added == port); grpc_tcp_server_start(&exec_ctx, server->tcp_server, &server->pollset, 1, @@ -91,13 +94,14 @@ void test_tcp_server_poll(test_tcp_server *server, int seconds) { gpr_time_from_seconds(seconds, GPR_TIMESPAN)); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; gpr_mu_lock(server->mu); - grpc_pollset_work(&exec_ctx, server->pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), deadline); + GRPC_LOG_IF_ERROR("pollset_work", + grpc_pollset_work(&exec_ctx, server->pollset, &worker, + gpr_now(GPR_CLOCK_MONOTONIC), deadline)); gpr_mu_unlock(server->mu); grpc_exec_ctx_finish(&exec_ctx); } -static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, bool success) {} +static void do_nothing(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {} void test_tcp_server_destroy(test_tcp_server *server) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; |