Pyro5.core — core Pyro logic¶
Multi purpose stuff used by both clients and servers (URI etc)
Pyro object URI (universal resource identifier). The uri format is like this:
PYRO:objectid@locationwhere location is one of:
hostname:port(tcp/ip socket on given port)
./u:sockname(Unix domain socket on localhost)
- There is also a ‘Magic format’ for simple name resolution using Name server:
PYRONAME:objectname[@location](optional name server location, can also omit location port)
- And one that looks up things in the name server by metadata:
PYROMETA:meta1,meta2,...[@location](optional name server location, can also omit location port)
You can write the protocol in lowercase if you like (
pyro:...) but it will automatically be converted to uppercase internally.
determine if a location string is for a Unix domain socket
property containing the location string, for instance
resolve(uri: Union[str, Pyro5.core.URI], delay_time: float = 0.0) → Pyro5.core.URI¶
Resolve a ‘magic’ uri (PYRONAME, PYROMETA) into the direct PYRO uri. It finds a name server, and use that to resolve a PYRONAME uri into the direct PYRO uri pointing to the named object. If uri is already a PYRO uri, it is returned unmodified. You can consider this a shortcut function so that you don’t have to locate and use a name server proxy yourself. Note: if you need to resolve more than a few names, consider using the name server directly instead of repeatedly calling this function, to avoid the name server lookup overhead from each call. You can set delay_time to the maximum number of seconds you are prepared to wait until a name registration becomes available in the nameserver.
locate_ns(host: Union[str, ipaddress.IPv4Address, ipaddress.IPv6Address] = '', port: Optional[int] = None, broadcast: bool = True) → client.Proxy¶
Get a proxy for a name server somewhere in the network.
extracts type metadata from the given class or object, can be used as Name server metadata.