mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-06 21:56:25 +01:00
Return error on invalid PGM url instead of raising assertion.
Fix Win32 build.
This commit is contained in:
@@ -55,6 +55,9 @@
|
||||
#include "address.hpp"
|
||||
#include "ipc_address.hpp"
|
||||
#include "tcp_address.hpp"
|
||||
#ifdef ZMQ_HAVE_OPENPGM
|
||||
#include "pgm_socket.hpp"
|
||||
#endif
|
||||
|
||||
#include "pair.hpp"
|
||||
#include "pub.hpp"
|
||||
@@ -510,6 +513,17 @@ int zmq::socket_base_t::connect (const char *addr_)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef ZMQ_HAVE_OPENPGM
|
||||
if (protocol == "pgm" || protocol == "epgm") {
|
||||
struct pgm_addrinfo_t *res = NULL;
|
||||
uint16_t port_number = 0;
|
||||
int rc = pgm_socket_t::init_address(address.c_str(), &res, &port_number);
|
||||
if (res != NULL)
|
||||
pgm_freeaddrinfo (res);
|
||||
if (rc != 0 || port_number == 0)
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
// Create session.
|
||||
session_base_t *session = session_base_t::create (io_thread, true, this,
|
||||
|
||||
Reference in New Issue
Block a user