def _bind_by_addr(self, socket, addr):
    with self.lock:
        if (addr in range(32, 64)):
            if (self.sap[addr] is None):
                socket.bind(addr)
                self.sap[addr] = ServiceAccessPoint(addr, self)
                self.sap[addr].insert_socket(socket)
            else:
                raise Error(errno.EADDRINUSE)
        else:
            raise Error(errno.EACCES)
def _bind_by_addr(self, socket, addr):
    with self.lock:
        if (addr in range(32, 64)):
            if (self.sap[addr] is None):
                socket.bind(addr)
                self.sap[addr] = ServiceAccessPoint(addr, self)
                self.sap[addr].insert_socket(socket)
            else:
                raise Error(errno.EADDRINUSE)
        else:
            raise Error(errno.EACCES)