def is_connected(function):

    def wrapper(self, *args, **kwargs):
        if (not self._is_open):
            raise exceptions.ClientConnectionNotOpen()
        return function(self, *args, **kwargs)
    return wrapper
def is_connected(function):

    def wrapper(self, *args, **kwargs):
        if (not self._is_open):
            raise exceptions.ClientConnectionNotOpen()
        return function(self, *args, **kwargs)
    return wrapper