From 96d85b20982926e60d5065cba3203971c9eeed63 Mon Sep 17 00:00:00 2001 From: Steven McCoy Date: Tue, 28 Sep 2010 16:58:51 +0200 Subject: * 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. --- src/pgm_receiver.hpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/pgm_receiver.hpp') diff --git a/src/pgm_receiver.hpp b/src/pgm_receiver.hpp index bbdb31d..f32d37e 100644 --- a/src/pgm_receiver.hpp +++ b/src/pgm_receiver.hpp @@ -73,15 +73,13 @@ namespace zmq struct tsi_comp { - inline bool operator () (const pgm_tsi_t <si, + bool operator () (const pgm_tsi_t <si, const pgm_tsi_t &rtsi) const { - if (ltsi.sport < rtsi.sport) - return true; - - return (std::lexicographical_compare (ltsi.gsi.identifier, - ltsi.gsi.identifier + 6, - rtsi.gsi.identifier, rtsi.gsi.identifier + 6)); + uint32_t ll[2], rl[2]; + memcpy (ll, <si, sizeof (ll)); + memcpy (rl, &rtsi, sizeof (rl)); + return (ll[0] < rl[0]) || (ll[0] == rl[0] && ll[1] < rl[1]); } }; -- cgit v1.2.3