diff options
author | murgatroid99 <mlumish@google.com> | 2016-09-23 13:49:05 -0700 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2016-09-23 13:49:05 -0700 |
commit | 7871f736ce62e74559602f928b25bea7389f57fb (patch) | |
tree | 1e134c30f7a4fe0d4d44d64ef22ff17c1d9b7999 /test/core/util | |
parent | bcc60f75d4b152c4e2eb000bece542f052770bfc (diff) |
Remove sockaddr type structs and socklen_t from internal core APIs, update POSIX tests
Diffstat (limited to 'test/core/util')
-rw-r--r-- | test/core/util/test_tcp_server.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/core/util/test_tcp_server.c b/test/core/util/test_tcp_server.c index 8a0b3932d8..ee2de563e8 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,18 +66,19 @@ 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); GPR_ASSERT(error == GRPC_ERROR_NONE); - error = grpc_tcp_server_add_port(server->tcp_server, &addr, sizeof(addr), + error = grpc_tcp_server_add_port(server->tcp_server, &resolved_addr, &port_added); GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(port_added == port); |