'set the High Water Mark
On libzmq â¥ 3, this sets both SNDHWM and RCVHWM
.. warning::
New values only take effect for subsequent socket
bind/connects.'

def set_hwm(self, value):

    major = zmq.zmq_version_info()[0]
    if (major >= 3):
        raised = None
        try:
            self.sndhwm = value
        except Exception as e:
            raised = e
        try:
            self.rcvhwm = value
        except Exception as e:
            raised = e
        if raised:
            raise raised
    else:
        return self.setsockopt(zmq.HWM, value)
