class DNSProtocol(DNSMixin, Int16StringReceiver): (source)
Constructor: DNSProtocol(controller, reactor)
DNS protocol over TCP.
| Method | connection |
Notify the controller that this protocol is no longer connected. |
| Method | connection |
Connection is made: reset internal state, and notify the controller. |
| Method | query |
Send out a message with the given queries. |
| Method | string |
Override this for notification when each complete string is received. |
| 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. |
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 | _clear |
Clean the Deferred after a timeout. |
| 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 Int16StringReceiver (via DNSMixin):
| Instance Variable | prefix |
Undocumented |
| Instance Variable | struct |
Undocumented |
Inherited from IntNStringReceiver (via DNSMixin, Int16StringReceiver):
| Method | data |
Convert int prefixed strings into calls to stringReceived. |
| Method | length |
Callback invoked when a length prefix greater than MAX_LENGTH is received. The default implementation disconnects the transport. Override this. |
| Method | send |
Send a prefixed string to the other end of the connection. |
| Constant | MAX |
Undocumented |
| Class Variable | recvd |
Undocumented |
| Instance Variable | _compatibility |
the offset within _unprocessed to the next message to be parsed. (used to generate the recvd attribute) |
| Instance Variable | _unprocessed |
bytes received, but not yet broken up into messages / sent to stringReceived. _compatibilityOffset must be updated when this value is updated so that the recvd attribute can be generated correctly. |
Inherited from Protocol (via DNSMixin, Int16StringReceiver, IntNStringReceiver):
| Method | log |
Return a prefix matching the class name, to identify log messages related to this protocol instance. |
| Class Variable | factory |
Undocumented |
Inherited from BaseProtocol (via DNSMixin, Int16StringReceiver, IntNStringReceiver, Protocol):
| Method | make |
Make a connection to a transport and a server. |
| Instance Variable | connected |
Undocumented |
| Instance Variable | transport |
Undocumented |
Inherited from _PauseableMixin (via DNSMixin, Int16StringReceiver, IntNStringReceiver, Protocol, BaseProtocol):
| Method | pause |
Undocumented |
| Method | resume |
Undocumented |
| Method | stop |
Undocumented |
| Instance Variable | paused |
Undocumented |
Override this for notification when each complete string is received.
| Parameters | |
data:bytes | Undocumented |
| string:bytes | The complete string which was received with all framing (length prefix, etc) removed. |
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.