From 5d8fbe266322fca7ff192a222e16733c020e4960 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 21 Jan 2015 16:33:54 -0800 Subject: Make this socket creation portable --- test/core/iomgr/tcp_client_posix_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/core/iomgr/tcp_client_posix_test.c') diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c index 79ba777e85..f9212e7373 100644 --- a/test/core/iomgr/tcp_client_posix_test.c +++ b/test/core/iomgr/tcp_client_posix_test.c @@ -40,6 +40,7 @@ #include #include "src/core/iomgr/iomgr.h" +#include "src/core/iomgr/socket_utils_posix.h" #include #include @@ -138,7 +139,8 @@ void test_times_out(void) { /* tie up the listen buffer, which is somewhat arbitrarily sized. */ for (i = 0; i < NUM_CLIENT_CONNECTS; ++i) { - client_fd[i] = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0); + client_fd[i] = socket(AF_INET, SOCK_STREAM, 0); + grpc_set_socket_nonblocking(client_fd[i], 1); do { r = connect(client_fd[i], (struct sockaddr *)&addr, addr_len); } while (r == -1 && errno == EINTR); -- cgit v1.2.3