class DNSDatagramProtocol(DNSMixin, protocol.DatagramProtocol): (source)
Constructor: DNSDatagramProtocol(controller, reactor)
DNS protocol over UDP.
| Method | datagram |
Read a datagram, extract the message in it and trigger the associated Deferred. |
| Method | query |
Send out a message with the given queries. |
| Method | remove |
Mark message ID as no longer having duplication suppression. |
| Method | start |
Undocumented |
| Method | start |
Upon start, reset internal state. |
| Method | stop |
Stop protocol: reset state variables. |
| Method | write |
Send a message holding DNS queries. |
| Instance Variable | live |
a dictionary mapping message-ID to the Deferred that will fire when it completes, and the pending timeout that will cause it to fail, for all outstanding queries that have not yet received a response. |
| Instance Variable | resends |
Undocumented |
| Instance Variable | transport |
Undocumented |
| Method | _clear |
Clean the Deferred after a timeout. |
| Instance Variable | _address |
a map of {message-id: expected source-address}; when issuing a DNS query over UDP, the response to that query ought to come from the same network address (host and port) that we issued it to. If it doesn't, we discard it... |
Inherited from DNSMixin:
| Method | __init__ |
Undocumented |
| Method | call |
Wrapper around reactor.callLater, mainly for test purpose. |
| Method | pick |
Return a unique ID for queries. |
| Instance Variable | controller |
Undocumented |
| Instance Variable | id |
Undocumented |
| Method | _handle |
Handle an incoming DNS message. |
| Method | _query |
Send out a message with the given queries. |
| Instance Variable | _reactor |
A IReactorTime and IReactorUDP provider which will be used to issue DNS queries and manage request timeouts. |
Inherited from DatagramProtocol (via DNSMixin):
| Method | connection |
Called due to error from write in connected mode. |
| Method | log |
Return a prefix matching the class name, to identify log messages related to this protocol instance. |
Inherited from AbstractDatagramProtocol (via DNSMixin, DatagramProtocol):
| Method | __getstate__ |
Undocumented |
| Method | do |
Make sure startProtocol is called. |
| Method | do |
Make sure stopProtocol is called. |
| Method | make |
Make a connection to a transport and a server. |
| Class Variable | noisy |
Undocumented |
| Instance Variable | num |
Undocumented |
twisted.names.dns.DNSMixin.liveMessagesa dictionary mapping message-ID to the Deferred that will fire when it completes, and the pending timeout that will cause it to fail, for all outstanding queries that have not yet received a response.
a map of {message-id: expected source-address}; when issuing a DNS query over UDP, the response to that query ought to come from the same network address (host and port) that we issued it to. If it doesn't, we discard it. The keys in this dictionary ought to match those in DNSMixin.liveMessages.