MediaWiki master
|
Public Member Functions | |
__construct (string $service, string $protocol='tcp', ?string $domain=null, ?callable $resolver=null) | |
Construct a new discoverer for the given domain, service, and protocol. | |
getRecords () | |
Queries the resolver for an SRV resource record matching the service, protocol, and domain and returns all target/port/priority/weight records. | |
getServers () | |
Performs discovery for the domain, service, and protocol, and returns a list of resolved server name/ip and port number pairs sorted by each record's priority, with servers of the same priority randomly shuffled. | |
getSrvName () | |
Returns the SRV resource record name. | |
Definition at line 26 of file DnsSrvDiscoverer.php.
DnsSrvDiscoverer::__construct | ( | string | $service, |
string | $protocol = 'tcp', | ||
?string | $domain = null, | ||
?callable | $resolver = null ) |
Construct a new discoverer for the given domain, service, and protocol.
string | $service | Name of the service to discover. |
string | $protocol | Service protocol. Defaults to 'tcp' |
?string | $domain | The hostname/domain on which to perform discovery of the given service and protocol. Defaults to null which effectively performs a query relative to the host's configured search domain. |
?callable | $resolver | Resolver function. Defaults to using dns_get_record. Primarily useful in testing. |
Definition at line 58 of file DnsSrvDiscoverer.php.
DnsSrvDiscoverer::getRecords | ( | ) |
Queries the resolver for an SRV resource record matching the service, protocol, and domain and returns all target/port/priority/weight records.
Definition at line 80 of file DnsSrvDiscoverer.php.
References getSrvName().
Referenced by getServers().
DnsSrvDiscoverer::getServers | ( | ) |
Performs discovery for the domain, service, and protocol, and returns a list of resolved server name/ip and port number pairs sorted by each record's priority, with servers of the same priority randomly shuffled.
Definition at line 113 of file DnsSrvDiscoverer.php.
References getRecords().
DnsSrvDiscoverer::getSrvName | ( | ) |
Returns the SRV resource record name.
Definition at line 138 of file DnsSrvDiscoverer.php.
Referenced by getRecords().