diff options
author | Brett Cameron <Brett.Cameron@hp.com> | 2010-05-12 12:45:12 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-05-12 12:45:12 +0200 |
commit | 714a8d50a03e773320a02247847c58020c96e867 (patch) | |
tree | 6f443d803d7cd52573d77af068f6e030f114620e /src/tcp_connecter.cpp | |
parent | a25414e55caa975185ac6534c40bb601e5c38a9a (diff) |
fixes for OpenVMS
Diffstat (limited to 'src/tcp_connecter.cpp')
-rw-r--r-- | src/tcp_connecter.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp index 1286187..17c0257 100644 --- a/src/tcp_connecter.cpp +++ b/src/tcp_connecter.cpp @@ -140,6 +140,10 @@ zmq::fd_t zmq::tcp_connecter_t::connect () #include <netdb.h> #include <fcntl.h> +#ifdef ZMQ_HAVE_OPENVMS +#include <ioctl.h> +#endif + zmq::tcp_connecter_t::tcp_connecter_t () : s (retired_fd) { @@ -176,11 +180,17 @@ int zmq::tcp_connecter_t::open () return -1; // Set to non-blocking mode. - int flags = fcntl (s, F_GETFL, 0); - if (flags == -1) +#ifdef ZMQ_HAVE_OPENVMS + int flags = 1; + int rc = ioctl (s, FIONBIO, &flags); + errno_assert (rc != -1); +#else + int flags = fcntl (s, F_GETFL, 0); + if (flags == -1) flags = 0; - int rc = fcntl (s, F_SETFL, flags | O_NONBLOCK); + int rc = fcntl (s, F_SETFL, flags | O_NONBLOCK); errno_assert (rc != -1); +#endif // Disable Nagle's algorithm. int flag = 1; @@ -215,6 +225,8 @@ int zmq::tcp_connecter_t::open () errno = err; return -1; } + +#ifndef ZMQ_HAVE_OPENVMS else { // Create the socket. @@ -243,6 +255,7 @@ int zmq::tcp_connecter_t::open () errno = err; return -1; } +#endif zmq_assert (false); return -1; |