ot::Srp::Client::RemoveHostAndServices() method
Starts the remove process of the host info and all services. After returning from this method, `Callback` will be called to report the status of remove request with SRP server. If the host info is to be permanently removed from server, @p aRemoveKeyLease should be set to `true` which removes the key lease associated with host on server. Otherwise, the key lease record is kept as before, which ensures that the server holds the host name in reserve for when the client once again able to provide and register its service(s). The @p aSendUnregToServer determines the behavior when the host info is not yet registered with the server. If @p aSendUnregToServer is set to `false` (which is the default/expected value) then the SRP client will immediately remove the host info and services without sending an update message to server (no need to update the server if nothing is yet registered with it). If @p aSendUnregToServer is set to `true` then the SRP client will send an update message to the server. Note that if the host info is registered then the value of @p aSendUnregToServer does not matter and the SRP client will always send an update message to server requesting removal of all info. One situation where @p aSendUnregToServer can be useful is on a device reset/reboot, caller may want to remove any previously registered services with the server. In this case, caller can `SetHostName()` and then request `RemoveHostAndServices()` with `aSendUnregToServer` as `true`.
Arguments
aShouldRemoveKeyLease
A boolean indicating whether or not the host key lease should also be removed.
aSendUnregToServer
A boolean indicating whether to send update to server when host info is not registered.
Return value
kErrorNone The removal of host and services started successfully. The `Callback` will be called to report the status. kErrorAlready The host is already removed.
ot::Srp::Client::RemoveHostAndServices() calls 2 functions:
![]()
ot::Srp::Client::RemoveHostAndServices()
ot::Srp::Client::RemoveHostAndServices() reads 4 variables and writes 1 variable:
![]()
ot::Srp::Client::RemoveHostAndServices()