Commit 7c25feb5 authored by Martin Sustrik's avatar Martin Sustrik

ZMQII-55: At most one PGM/UDP transport can be opened

parent 9cee8f9c
...@@ -78,17 +78,18 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_) ...@@ -78,17 +78,18 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
nbytes_processed = 0; nbytes_processed = 0;
pgm_msgv_processed = 0; pgm_msgv_processed = 0;
int rc;
GError *pgm_error = NULL; GError *pgm_error = NULL;
// Init PGM transport. // Init PGM transport if not already done.
// Ensure threading enabled, ensure timer enabled and find PGM protocol id. // Ensure threading enabled, ensure timer enabled and find PGM protocol id.
// //
// Note that if you want to use gettimeofday and sleep for openPGM timing, // Note that if you want to use gettimeofday and sleep for openPGM timing,
// set environment variables PGM_TIMER to "GTOD" // set environment variables PGM_TIMER to "GTOD"
// and PGM_SLEEP to "USLEEP". // and PGM_SLEEP to "USLEEP".
int rc = pgm_init (&pgm_error); if (!pgm_supported ()) {
rc = pgm_init (&pgm_error);
if (rc != TRUE) { if (rc != TRUE) {
if (pgm_error->domain == PGM_IF_ERROR && ( if (pgm_error->domain == PGM_IF_ERROR && (
pgm_error->code == PGM_IF_ERROR_INVAL || pgm_error->code == PGM_IF_ERROR_INVAL ||
pgm_error->code == PGM_IF_ERROR_XDEV || pgm_error->code == PGM_IF_ERROR_XDEV ||
...@@ -106,6 +107,7 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_) ...@@ -106,6 +107,7 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
zmq_assert (false); zmq_assert (false);
} }
}
// PGM transport GSI. // PGM transport GSI.
pgm_gsi_t gsi; pgm_gsi_t gsi;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment