diff options
author | 2016-11-02 12:06:57 -0700 | |
---|---|---|
committer | 2016-11-02 12:06:57 -0700 | |
commit | 1c0b7a2d180f44012b302eb17ce103f6b4d45752 (patch) | |
tree | 977457c5f4aac78f1e364d7e64adf5f0e2e8b869 /test/core/util/test_tcp_server.c | |
parent | 68413c221e341f4f00326e892077c5fcd4b4f788 (diff) | |
parent | 11948f74414e6c95b81fbcc2f0d06afa0b1cbce5 (diff) |
Merge remote-tracking branch 'upstream/master' into get_tos
Diffstat (limited to 'test/core/util/test_tcp_server.c')
-rw-r--r-- | test/core/util/test_tcp_server.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/test/core/util/test_tcp_server.c b/test/core/util/test_tcp_server.c index 8a0b3932d8..16df91d968 100644 --- a/test/core/util/test_tcp_server.c +++ b/test/core/util/test_tcp_server.c @@ -31,6 +31,8 @@ * */ +#include "src/core/lib/iomgr/sockaddr.h" + #include "test/core/util/test_tcp_server.h" #include <grpc/grpc.h> @@ -41,7 +43,7 @@ #include <grpc/support/time.h> #include <string.h> #include "src/core/lib/iomgr/endpoint.h" -#include "src/core/lib/iomgr/sockaddr.h" +#include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/tcp_server.h" #include "test/core/util/port.h" @@ -64,19 +66,20 @@ void test_tcp_server_init(test_tcp_server *server, } void test_tcp_server_start(test_tcp_server *server, int port) { - struct sockaddr_in addr; + grpc_resolved_address resolved_addr; + struct sockaddr_in *addr = (struct sockaddr_in *)resolved_addr.addr; int port_added; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - addr.sin_family = AF_INET; - addr.sin_port = htons((uint16_t)port); - memset(&addr.sin_addr, 0, sizeof(addr.sin_addr)); + addr->sin_family = AF_INET; + addr->sin_port = htons((uint16_t)port); + memset(&addr->sin_addr, 0, sizeof(addr->sin_addr)); - grpc_error *error = grpc_tcp_server_create(&server->shutdown_complete, NULL, - &server->tcp_server); + grpc_error *error = grpc_tcp_server_create( + &exec_ctx, &server->shutdown_complete, NULL, &server->tcp_server); GPR_ASSERT(error == GRPC_ERROR_NONE); - error = grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr), - &port_added); + error = + grpc_tcp_server_add_port(server->tcp_server, &resolved_addr, &port_added); GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(port_added == port); |