diff options
author | kpayson64 <kpayson@google.com> | 2018-03-12 19:16:30 -0700 |
---|---|---|
committer | kpayson64 <kpayson@google.com> | 2018-03-13 01:21:42 -0700 |
commit | 539f5068bd14e3d07b58309b657222919e94aba5 (patch) | |
tree | bc5980993f806841a79c973d302524ab8adba576 /test/core/util | |
parent | 44fd6557aefad4689eac7225386aecefd1f9a5bc (diff) |
Abstract libuv implementation
Structures the libuv implementation to allow for a plugable
BSD style socket implementation to allow for other IO Managers
Diffstat (limited to 'test/core/util')
-rw-r--r-- | test/core/util/test_tcp_server.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/core/util/test_tcp_server.cc b/test/core/util/test_tcp_server.cc index cb2bc701fa..610a9918ce 100644 --- a/test/core/util/test_tcp_server.cc +++ b/test/core/util/test_tcp_server.cc @@ -17,6 +17,7 @@ */ #include "src/core/lib/iomgr/sockaddr.h" +#include "src/core/lib/iomgr/socket_utils.h" #include "test/core/util/test_tcp_server.h" @@ -54,13 +55,13 @@ void test_tcp_server_init(test_tcp_server* server, void test_tcp_server_start(test_tcp_server* server, int port) { grpc_resolved_address resolved_addr; - struct sockaddr_in* addr = - reinterpret_cast<struct sockaddr_in*>(resolved_addr.addr); + grpc_sockaddr_in* addr = + reinterpret_cast<grpc_sockaddr_in*>(resolved_addr.addr); int port_added; grpc_core::ExecCtx exec_ctx; - addr->sin_family = AF_INET; - addr->sin_port = htons(static_cast<uint16_t>(port)); + addr->sin_family = GRPC_AF_INET; + addr->sin_port = grpc_htons(static_cast<uint16_t>(port)); memset(&addr->sin_addr, 0, sizeof(addr->sin_addr)); grpc_error* error = grpc_tcp_server_create(&server->shutdown_complete, |