def _bind_by_name(self, socket, name):
        if not (name.startswith("urn:nfc:sn") or
                name.startswith("urn:nfc:xsn") or
                name == "com.android.npp"): # invalid name but legacy
            raise Error(errno.EFAULT)
        with self.lock:
            if self.snl.get(name) != None:
                raise Error(errno.EADDRINUSE)
            addr = wks_map.get(name)
            if addr is None:
                try: addr = 16 + self.sap[16:32].index(None)
                except __HOLE__: raise Error(errno.EADDRNOTAVAIL)
            socket.bind(addr)
            self.sap[addr] = ServiceAccessPoint(addr, self)
            self.sap[addr].insert_socket(socket)
            self.snl[name] = addr
dataset/ETHPy150Open javgh/greenaddress-pos-tools/nfc/llcp/llc.py/LogicalLinkController._bind_by_name