* 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.
This commit is contained in:
Steven McCoy
2010-09-28 16:58:51 +02:00
committed by Martin Sustrik
parent 00cd7d49c7
commit 96d85b2098
4 changed files with 87 additions and 60 deletions

View File

@@ -73,15 +73,13 @@ namespace zmq
struct tsi_comp
{
inline bool operator () (const pgm_tsi_t &ltsi,
bool operator () (const pgm_tsi_t &ltsi,
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, &ltsi, sizeof (ll));
memcpy (rl, &rtsi, sizeof (rl));
return (ll[0] < rl[0]) || (ll[0] == rl[0] && ll[1] < rl[1]);
}
};