| |
- __builtin__.object
-
- Asyncns
- Query
-
- AddrInfoQuery
- NameInfoQuery
- ResQuery
class AddrInfoQuery(Query) |
|
The class for getaddrinfo() calls. |
|
- Method resolution order:
- AddrInfoQuery
- Query
- __builtin__.object
Methods defined here:
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- get_done(...)
- get_done()
Return the result of the query.
The result is a list of tuples:
(host, port) for IPv4, (host, port, flowinfo, scopeid) for IPv6.
Methods inherited from Query:
- cancel(...)
- cancel()
Cancels the query.
- is_done(...)
- is_done()
Tells if the request has been completed.
Data descriptors inherited from Query:
- userdata
- Attribute available to store user data.
Data and other attributes inherited from Query:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class Asyncns(__builtin__.object) |
|
The session class.
Asyncns(n_proc = 5) |
|
Methods defined here:
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- get_fd(...)
- get_fd()
Return the UNIX file descriptor to select() for readability on.
Use this function to integrate libasyncns with your custom main loop.
- get_next(...)
- get_next()
Return the next completed query object.
If no query has been completed yet, return None.
Please note that you need to run wait() before this function
will return sensible data.
- get_nqueries(...)
- get_nqueries()
Return the number of query objects (completed or not).
- getaddrinfo(...)
- getaddrinfo(host, proto, family = AF_UNSPEC, socktype = 0, proto = 0, flags = 0)
Issue a name to address query.
The arguments are compatible with the ones of the socket module.
The function returns a new AddrInfoQuery object.
- getnameinfo(...)
- getnameinfo(sockaddr, flags = 0)
Issue an address to name query.
The arguments are compatible with the ones of the socket module.
The function returns a new NameInfoQuery object.
- res_query(...)
- res_query(dname, class, type)
Issue an resolver query.
The arguments are compatible with the ones of libc's res_query(3).
The function returns a new ResQuery object.
- wait(...)
- wait(block = True)
Process pending events.
After this function is called you can get the next completed query
object(s) using get_next(). If block is True wait until at least
one response has been processed. If block is False, process
all pending responses and return.
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class NameInfoQuery(Query) |
|
The class for getnameinfo() calls. |
|
- Method resolution order:
- NameInfoQuery
- Query
- __builtin__.object
Methods defined here:
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- get_done(...)
- get_done()
Return the result of the query.
The result is a tuple of 2 items.
The first item is the host name, the second one is the service name.
Methods inherited from Query:
- cancel(...)
- cancel()
Cancels the query.
- is_done(...)
- is_done()
Tells if the request has been completed.
Data descriptors inherited from Query:
- userdata
- Attribute available to store user data.
Data and other attributes inherited from Query:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class Query(__builtin__.object) |
|
A generic query class. |
|
Methods defined here:
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- cancel(...)
- cancel()
Cancels the query.
- is_done(...)
- is_done()
Tells if the request has been completed.
Data descriptors defined here:
- userdata
- Attribute available to store user data.
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class ResQuery(Query) |
|
The class for res_query() calls. |
|
- Method resolution order:
- ResQuery
- Query
- __builtin__.object
Methods defined here:
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- get_done(...)
- get_done()
Return the result of the query.
The result is a list of dictionaries with the following keys:
'weight', 'pref', 'host', 'port', 'length', 'ttl', 'type', 'class'
Methods inherited from Query:
- cancel(...)
- cancel()
Cancels the query.
- is_done(...)
- is_done()
Tells if the request has been completed.
Data descriptors inherited from Query:
- userdata
- Attribute available to store user data.
Data and other attributes inherited from Query:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
| |