diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-07-15 11:24:33 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-07-15 11:24:33 +0200 |
commit | c8e8f2a24cd339c548e06f75a3cef96454671a85 (patch) | |
tree | b8ea021d0755acedca74563cfc74921634071f83 /src/pgm_socket.cpp | |
parent | ba67eff167e94105b0975166a2192060ab125e58 (diff) |
ZMQ_IDENTITY socket option removed
This patch simplifies the whole codebase significantly,
including dropping depedency on libuuid.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/pgm_socket.cpp')
-rw-r--r-- | src/pgm_socket.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/pgm_socket.cpp b/src/pgm_socket.cpp index 90a265c..98aeeb9 100644 --- a/src/pgm_socket.cpp +++ b/src/pgm_socket.cpp @@ -38,7 +38,7 @@ #include "pgm_socket.hpp" #include "config.hpp" #include "err.hpp" -#include "uuid.hpp" +#include "random.hpp" #include "stdint.hpp" #ifndef MSG_ERRQUEUE @@ -253,20 +253,13 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_) addr.sa_port = port_number; addr.sa_addr.sport = DEFAULT_DATA_SOURCE_PORT; - if (options.identity.size () > 0) { - - // Create gsi from identity. - if (!pgm_gsi_create_from_data (&addr.sa_addr.gsi, - options.identity.data (), options.identity.size ())) - goto err_abort; - } else { + // Create random GSI. + uint32_t buf [2]; + buf [0] = generate_random (); + buf [1] = generate_random (); + if (!pgm_gsi_create_from_data (&addr.sa_addr.gsi, (uint8_t*) buf, 8)) + goto err_abort; - // Generate GSI from UUID. - unsigned char buf [16]; - generate_uuid (buf); - if (!pgm_gsi_create_from_data (&addr.sa_addr.gsi, buf, 16)) - goto err_abort; - } // Bind a transport to the specified network devices. struct pgm_interface_req_t if_req; |