'get the High Water Mark
On libzmq â¥ 3, this gets SNDHWM if available, otherwise RCVHWM'

def get_hwm(self):

    major = zmq.zmq_version_info()[0]
    if (major >= 3):
        try:
            return self.getsockopt(zmq.SNDHWM)
        except zmq.ZMQError:
            pass
        return self.getsockopt(zmq.RCVHWM)
    else:
        return self.getsockopt(zmq.HWM)
