diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-01-21 16:33:54 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-01-21 16:33:54 -0800 |
commit | 5d8fbe266322fca7ff192a222e16733c020e4960 (patch) | |
tree | 8abc6f36c4cae56d9a99349908329dd129f0d244 /test/core | |
parent | 96b49557ec34ed52ac067089a9b496b27d9a0218 (diff) |
Make this socket creation portable
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/iomgr/tcp_client_posix_test.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 <unistd.h> #include "src/core/iomgr/iomgr.h" +#include "src/core/iomgr/socket_utils_posix.h" #include <grpc/support/log.h> #include <grpc/support/time.h> @@ -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); |