NsdServiceInfo.SetAttribute(String, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Add a service attribute as a key/value pair.
[Android.Runtime.Register("setAttribute", "(Ljava/lang/String;Ljava/lang/String;)V", "")]
public void SetAttribute (string? key, string? value);
[<Android.Runtime.Register("setAttribute", "(Ljava/lang/String;Ljava/lang/String;)V", "")>]
member this.SetAttribute : string * string -> unit
Parameters
- key
- String
- value
- String
- Attributes
Remarks
Add a service attribute as a key/value pair.
Service attributes are included as DNS-SD TXT record pairs.
The key must be US-ASCII printable characters, excluding the '=' character. Values may be UTF-8 strings or null. The total length of key + value must be less than 255 bytes.
Keys should be short, ideally no more than 9 characters, and unique per instance of NsdServiceInfo
. Calling #setAttribute
twice with the same key will overwrite first value.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.