pub enum DnsServerWatcherRequest {
WatchServers {
responder: DnsServerWatcherWatchServersResponder,
},
CheckPresence {
responder: DnsServerWatcherCheckPresenceResponder,
},
}
Expand description
Provides a hanging get interface to watch for DNS servers configuration. Only one connection to this service is considered valid at any one time.
Variants§
WatchServers
Returns a list of DNS servers registered with the socketproxy.
First call always returns a snapshot of the current list of servers or blocks if an empty list would be returned. Subsequent calls will block until the list of servers changes.
The list of servers changes over time by configuration or network topology changes,
expiration, etc. Callers must repeatedly call WatchServers
and replace any previously
returned servers
with new ones to avoid using stale or expired entries.
It is invalid to call this method while a previous call is pending. Doing so will cause the server end of the protocol to be closed.
- response
servers
The list of servers to use for DNS resolution, in priority order.
Fields
responder: DnsServerWatcherWatchServersResponder
CheckPresence
No-op method that allows checking for presence.
TODO(https://fxbug.dev/296283299): It’s not currently possible for a client with an optionally-provided protocol to check whether there’s someone on the other end without making a FIDL call . This method provides a workaround by giving a client a method that it can call to check for liveness.
Fields
responder: DnsServerWatcherCheckPresenceResponder
Implementations§
Source§impl DnsServerWatcherRequest
impl DnsServerWatcherRequest
pub fn into_watch_servers(self) -> Option<DnsServerWatcherWatchServersResponder>
pub fn into_check_presence( self, ) -> Option<DnsServerWatcherCheckPresenceResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL