class documentation

DNS protocol over TCP.

Method connectionLost Notify the controller that this protocol is no longer connected.
Method connectionMade Connection is made: reset internal state, and notify the controller.
Method query Send out a message with the given queries.
Method stringReceived Override this for notification when each complete string is received.
Method writeMessage Send a message holding DNS queries.
Instance Variable liveMessages 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 callLater Wrapper around reactor.callLater, mainly for test purpose.
Method pickID Return a unique ID for queries.
Instance Variable controller Undocumented
Instance Variable id Undocumented
Method _clearFailed Clean the Deferred after a timeout.
Method _handleResponse 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 prefixLength Undocumented
Instance Variable structFormat Undocumented

Inherited from IntNStringReceiver (via DNSMixin, Int16StringReceiver):

Method dataReceived Convert int prefixed strings into calls to stringReceived.
Method lengthLimitExceeded Callback invoked when a length prefix greater than MAX_LENGTH is received. The default implementation disconnects the transport. Override this.
Method sendString Send a prefixed string to the other end of the connection.
Constant MAX_LENGTH Undocumented
Class Variable recvd Undocumented
Instance Variable _compatibilityOffset 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 logPrefix 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 makeConnection 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 pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Undocumented
Instance Variable paused Undocumented
def connectionLost(self, reason): (source)

Notify the controller that this protocol is no longer connected.

def connectionMade(self): (source)

Connection is made: reset internal state, and notify the controller.

def query(self, queries: list[Query], timeout: float = 60) -> Deferred[Message]: (source)

Send out a message with the given queries.

Parameters
queries:list of Query instancesThe queries to transmit
timeout:floatUndocumented
Returns
DeferredUndocumented
def stringReceived(self, data: bytes): (source)

Override this for notification when each complete string is received.

Parameters
data:bytesUndocumented
string:bytesThe complete string which was received with all framing (length prefix, etc) removed.
def writeMessage(self, message): (source)

Send a message holding DNS queries.

Parameters
message:MessageUndocumented
liveMessages: dict = (source)

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.