class documentation
class DNSProtocol(DNSMixin, protocol.Protocol): (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 | data |
Called whenever data is received. |
| Method | query |
Send out a message with the given queries. |
| Method | write |
Send a message holding DNS queries. |
| Instance Variable | buffer |
Undocumented |
| Instance Variable | length |
Undocumented |
| Instance Variable | live |
Undocumented |
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 | _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 Protocol (via DNSMixin):
| 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, Protocol):
| Method | make |
Make a connection to a transport and a server. |
| Instance Variable | connected |
Undocumented |
| Instance Variable | transport |
Undocumented |
Called whenever data is received.
Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.
| Parameters | |
| data | a string of indeterminate length. Please keep in mind that you will probably need to buffer some data, as partial (or multiple) protocol messages may be received! I recommend that unit tests for protocols call through to this method with differing chunk sizes, down to one byte at a time. |
Send out a message with the given queries.
| Parameters | |
queries:list of Query instances | The queries to transmit |
| timeout | Undocumented |
| Returns | |
| Deferred | Undocumented |