summaryrefslogtreecommitdiff
path: root/src/socket_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket_base.cpp')
-rw-r--r--src/socket_base.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 8ee8bd3..f1e7fca 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -34,6 +34,9 @@
#else
#include <unistd.h>
#endif
+#ifdef XS_HAVE_OPENPGM
+#include "pgm_socket.hpp"
+#endif
#include "socket_base.hpp"
#include "tcp_listener.hpp"
@@ -508,6 +511,18 @@ int xs::socket_base_t::connect (const char *addr_)
}
}
+#ifdef XS_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 (thread, true, this,
options, protocol.c_str (), address.c_str ());