summaryrefslogtreecommitdiff
path: root/src/zmq.cpp
diff options
context:
space:
mode:
authorSteven McCoy <steven.mccoy@miru.hk>2010-09-28 16:58:51 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-30 09:11:19 +0200
commit96d85b20982926e60d5065cba3203971c9eeed63 (patch)
treec2d29faea3ec82b836b47e9d73de8f3d0994591e /src/zmq.cpp
parent00cd7d49c7f2b532b2349581b82577bc714f9bf8 (diff)
* Add assertions to check for OpenPGM calls with invalid parameters.
* Assertion to check that pgm_getaddrinfo is actually returning something. * Missing pgm_connect call. * Typo on TOS causing immediate abort. * Placeholder calls for timeouts whilst continuing spin loop functionality. * OpenPGM v5 now supports reference counting so remove init checks. * Duplicate UDP unicast port setting, requires one unicast and one multicast. * Incorrectly set socket rcvbuf size with sndbuf. * Replace std::lexicographical_compare of TSI's with long word integer comparisons. * pgm_socket_t::receive returns -1 on no data.
Diffstat (limited to 'src/zmq.cpp')
-rw-r--r--src/zmq.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/zmq.cpp b/src/zmq.cpp
index 5b59802..306a85d 100644
--- a/src/zmq.cpp
+++ b/src/zmq.cpp
@@ -234,31 +234,27 @@ void *zmq_init (int io_threads_)
}
#if defined ZMQ_HAVE_OPENPGM
- // Unfortunately, OpenPGM doesn't support refcounted init/shutdown, thus,
- // let's fail if it was initialised beforehand.
- zmq_assert (!pgm_supported ());
// Init PGM transport. Ensure threading and timer are enabled. Find PGM
// protocol ID. Note that if you want to use gettimeofday and sleep for
// openPGM timing, set environment variables PGM_TIMER to "GTOD" and
// PGM_SLEEP to "USLEEP".
pgm_error_t *pgm_error = NULL;
- bool rc = pgm_init (&pgm_error);
+ const bool rc = pgm_init (&pgm_error);
if (rc != TRUE) {
- if (pgm_error->domain == PGM_ERROR_DOMAIN_IF && (
- pgm_error->code == PGM_ERROR_INVAL ||
- pgm_error->code == PGM_ERROR_XDEV ||
- pgm_error->code == PGM_ERROR_NODEV ||
- pgm_error->code == PGM_ERROR_NOTUNIQ ||
- pgm_error->code == PGM_ERROR_ADDRFAMILY ||
- pgm_error->code == PGM_ERROR_AFNOSUPPORT ||
- pgm_error->code == PGM_ERROR_NODATA ||
- pgm_error->code == PGM_ERROR_NONAME ||
- pgm_error->code == PGM_ERROR_SERVICE)) {
+
+ // Invalid parameters don't set pgm_error_t
+ zmq_assert (pgm_error != NULL);
+ if (pgm_error->domain == PGM_ERROR_DOMAIN_TIME && (
+ pgm_error->code == PGM_ERROR_FAILED)) {
+
+ // Failed to access RTC or HPET device.
pgm_error_free (pgm_error);
errno = EINVAL;
return NULL;
}
+
+ // PGM_ERROR_DOMAIN_ENGINE: WSAStartup errors or missing WSARecvMsg.
zmq_assert (false);
}
#endif