diff --git a/include/nzmqt/impl.hpp b/include/nzmqt/impl.hpp index 9d5d4ed5..9b7d5881 100644 --- a/include/nzmqt/impl.hpp +++ b/include/nzmqt/impl.hpp @@ -171,6 +171,16 @@ NZMQT_INLINE void ZMQSocket::bindTo(const char *addr_) bind(addr_); } +NZMQT_INLINE void ZMQSocket::unbindFrom(const QString& addr_) +{ + unbind(addr_.toLocal8Bit()); +} + +NZMQT_INLINE void ZMQSocket::unbindFrom(const char *addr_) +{ + unbind(addr_); +} + NZMQT_INLINE void ZMQSocket::connectTo(const QString& addr_) { zmqsuper::connect(addr_.toLocal8Bit()); @@ -181,6 +191,16 @@ NZMQT_INLINE void ZMQSocket::connectTo(const char* addr_) zmqsuper::connect(addr_); } +NZMQT_INLINE void ZMQSocket::disconnectFrom(const QString& addr_) +{ + zmqsuper::disconnect(addr_.toLocal8Bit()); +} + +NZMQT_INLINE void ZMQSocket::disconnectFrom(const char* addr_) +{ + zmqsuper::disconnect(addr_); +} + NZMQT_INLINE bool ZMQSocket::sendMessage(ZMQMessage& msg_, SendFlags flags_) { return send(msg_, flags_); @@ -335,6 +355,16 @@ NZMQT_INLINE void ZMQSocket::unsubscribeFrom(const QByteArray& filter_) setOption(OPT_UNSUBSCRIBE, filter_); } +NZMQT_INLINE void ZMQSocket::setSendHighWaterMark(int value_) +{ + setOption(OPT_SNDHWM, value_); +} + +NZMQT_INLINE void ZMQSocket::setReceiveHighWaterMark(int value_) +{ + setOption(OPT_RCVHWM, value_); +} + /* diff --git a/include/nzmqt/nzmqt.hpp b/include/nzmqt/nzmqt.hpp index 52b7c843..6b724e1b 100755 --- a/include/nzmqt/nzmqt.hpp +++ b/include/nzmqt/nzmqt.hpp @@ -176,7 +176,9 @@ namespace nzmqt OPT_LINGER = ZMQ_LINGER, OPT_RECONNECT_IVL = ZMQ_RECONNECT_IVL, OPT_RECONNECT_IVL_MAX = ZMQ_RECONNECT_IVL_MAX, - OPT_BACKLOG = ZMQ_BACKLOG + OPT_BACKLOG = ZMQ_BACKLOG, + OPT_SNDHWM = ZMQ_SNDHWM, + OPT_RCVHWM = ZMQ_RCVHWM }; ~ZMQSocket(); @@ -203,10 +205,18 @@ namespace nzmqt void bindTo(const char *addr_); + void unbindFrom(const QString& addr_); + + void unbindFrom(const char *addr_); + void connectTo(const QString& addr_); void connectTo(const char* addr_); + void disconnectFrom(const QString& addr_); + + void disconnectFrom(const char* addr_); + bool sendMessage(ZMQMessage& msg_, SendFlags flags_ = SND_NOBLOCK); // Receives a message or a message part. @@ -257,6 +267,10 @@ namespace nzmqt void unsubscribeFrom(const QByteArray& filter_); + void setSendHighWaterMark(int value_); + + void setReceiveHighWaterMark(int value_); + signals: void messageReceived(const QList&);