Known subclasses: twisted.test.test_ident.TestErrorIdentServer, twisted.test.test_ident.TestIdentServer

The Identification Protocol (a.k.a., "ident", a.k.a., "the Ident Protocol") provides a means to determine the identity of a user of a particular TCP connection. Given a TCP port number pair, it returns a character string which identifies the owner of that connection on the server's system.

Server authors should subclass this class and override the lookup method. The default implementation returns an UNKNOWN-ERROR response for every query.

Method lineReceived Override this for when each line is received.
Method invalidQuery Undocumented
Method validQuery Called when a valid query is received to look up and deliver the response.
Method lookup Lookup user information about the specified address pair.
Method _cbLookup Undocumented
Method _ebLookup Undocumented

Inherited from LineOnlyReceiver:

Class Variable delimiter The line-ending delimiter to use. By default this is b'\r\n'.
Class Variable MAX_LENGTH The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped). Default is 16384.
Method dataReceived Translates bytes into lines, and calls lineReceived.
Method sendLine Sends a line to the other end of the connection.
Method lineLengthExceeded Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.

Inherited from Protocol (via LineOnlyReceiver):

Method logPrefix Return a prefix matching the class name, to identify log messages related to this protocol instance.
Method connectionLost Called when the connection is shut down.

Inherited from BaseProtocol (via LineOnlyReceiver, Protocol):

Method makeConnection Make a connection to a transport and a server.
Method connectionMade Called when a connection is made.
def lineReceived(self, line):

Override this for when each line is received.

ParameterslineThe line which was received with the delimiter removed. (type: bytes)
def invalidQuery(self):
Undocumented
def validQuery(self, portOnServer, portOnClient):

Called when a valid query is received to look up and deliver the response.

ParametersportOnServerThe server port from the query.
portOnClientThe client port from the query.
def _cbLookup(self, result, sport, cport):
Undocumented
def _ebLookup(self, failure, sport, cport):
Undocumented
def lookup(self, serverAddress, clientAddress):

Lookup user information about the specified address pair.

Return value should be a two-tuple of system name and username. Acceptable values for the system name may be found online at:

   U{http://www.iana.org/assignments/operating-system-names}

This method may also raise any IdentError subclass (or IdentError itself) to indicate user information will not be provided for the given query.

A Deferred may also be returned.

ParametersserverAddressA two-tuple representing the server endpoint of the address being queried. The first element is a string holding a dotted-quad IP address. The second element is an integer representing the port.
clientAddressLike serverAddress, but represents the client endpoint of the address being queried.
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.