Undocumented
Method __init__
Method pickServer Pick the next server.

Inherited from SRVConnector:

Instance Variable servers List of candidate server records for future connection attempts. (type: list of dns.Record_SRV)
Instance Variable orderedServers List of server records that have already been tried in this round of connection attempts. (type: list of dns.Record_SRV)
Method connect Start connection to remote server.
Method stopConnecting Stop attempting to connect.
Method disconnect Disconnect whatever our are state is.
Method getDestination Return destination this will try to connect to.
Method connectionFailed Undocumented
Method connectionLost Undocumented
Method _ebGotServers Undocumented
Method _cbGotServers Undocumented
Method _ebServiceUnknown Connect to the default port when the service name is unknown.
Method _reallyConnect Undocumented
def __init__(self, reactor, domain, factory): (source)
ParametersdomainThe domain to connect to. If passed as a unicode string, it will be encoded using idna encoding. (type: bytes or unicode)
defaultPortOptional default port number to be used when SRV lookup fails and the service name is unknown. This should be the port number associated with the service name as defined by the IANA registry. (type: int)
def pickServer(self): (source)

Pick the next server.

This selects the next server from the list of SRV records according to their priority and weight values, as set out by the default algorithm specified in RFC 2782.

At the beginning of a round, servers is populated with orderedServers, and the latter is made empty. servers is the list of candidates, and orderedServers is the list of servers that have already been tried.

First, all records are ordered by priority and weight in ascending order. Then for each priority level, a running sum is calculated over the sorted list of records for that priority. Then a random value between 0 and the final sum is compared to each record in order. The first record that is greater than or equal to that random value is chosen and removed from the list of candidates for this round.

ReturnsA tuple of target hostname and port from the chosen DNS SRV record. (type: tuple of native str and int)
API Documentation for wokkel, generated by pydoctor at 2018-12-06 14:45:46.