summaryrefslogtreecommitdiff
path: root/include/zmq.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/zmq.hpp')
-rw-r--r--include/zmq.hpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/zmq.hpp b/include/zmq.hpp
index 004706b..0ba972b 100644
--- a/include/zmq.hpp
+++ b/include/zmq.hpp
@@ -230,9 +230,15 @@ namespace zmq
assert (rc == 0);
}
- inline void bind (const char *addr_, zmq_opts *opts_ = NULL)
+ template <typename T> inline void setsockopt (int option_, T &value_)
{
- int rc = zmq_bind (ptr, addr_, opts_);
+ int rc = zmq_setsockopt (ptr, option_, (void*) &value_, sizeof (T));
+ assert (rc == 0);
+ }
+
+ inline void bind (const char *addr_)
+ {
+ int rc = zmq_bind (ptr, addr_);
if (rc == -1) {
assert (errno == EINVAL || errno == EADDRINUSE);
if (errno == EINVAL)
@@ -242,9 +248,9 @@ namespace zmq
}
}
- inline void connect (const char *addr_, zmq_opts *opts_ = NULL)
+ inline void connect (const char *addr_)
{
- int rc = zmq_connect (ptr, addr_, opts_);
+ int rc = zmq_connect (ptr, addr_);
if (rc == -1) {
assert (errno == EINVAL || errno == EADDRINUSE);
if (errno == EINVAL)