From 714a8d50a03e773320a02247847c58020c96e867 Mon Sep 17 00:00:00 2001 From: Brett Cameron Date: Wed, 12 May 2010 12:45:12 +0200 Subject: fixes for OpenVMS --- src/tcp_connecter.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/tcp_connecter.cpp') 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 #include +#ifdef ZMQ_HAVE_OPENVMS +#include +#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; -- cgit v1.2.3