Compartilhar via


NsdManager.DiscoverServices Method

Definition

Overloads

DiscoverServices(String, NsdProtocol, NsdManager+IDiscoveryListener)

Initiate service discovery to browse for instances of a service type.

DiscoverServices(String, NsdProtocol, Network, IExecutor, NsdManager+IDiscoveryListener)
DiscoverServices(String, NsdProtocol, NetworkRequest, IExecutor, NsdManager+IDiscoveryListener)

DiscoverServices(String, NsdProtocol, NsdManager+IDiscoveryListener)

Initiate service discovery to browse for instances of a service type.

[Android.Runtime.Register("discoverServices", "(Ljava/lang/String;ILandroid/net/nsd/NsdManager$DiscoveryListener;)V", "")]
public void DiscoverServices (string? serviceType, Android.Net.Nsd.NsdProtocol protocolType, Android.Net.Nsd.NsdManager.IDiscoveryListener? listener);
[<Android.Runtime.Register("discoverServices", "(Ljava/lang/String;ILandroid/net/nsd/NsdManager$DiscoveryListener;)V", "")>]
member this.DiscoverServices : string * Android.Net.Nsd.NsdProtocol * Android.Net.Nsd.NsdManager.IDiscoveryListener -> unit

Parameters

serviceType
String

The service type being discovered. Examples include "_http._tcp" for http services or "_ipp._tcp" for printers

protocolType
NsdProtocol

The service discovery protocol

listener
NsdManager.IDiscoveryListener

The listener notifies of a successful discovery and is used to stop discovery on this serviceType through a call on #stopServiceDiscovery. Cannot be null. Cannot be in use for an active service discovery.

Attributes

Remarks

Java documentation for android.net.nsd.NsdManager.discoverServices(java.lang.String, int, android.net.nsd.DiscoveryListener).

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.

Applies to

DiscoverServices(String, NsdProtocol, Network, IExecutor, NsdManager+IDiscoveryListener)

[Android.Runtime.Register("discoverServices", "(Ljava/lang/String;ILandroid/net/Network;Ljava/util/concurrent/Executor;Landroid/net/nsd/NsdManager$DiscoveryListener;)V", "", ApiSince=33)]
public void DiscoverServices (string serviceType, Android.Net.Nsd.NsdProtocol protocolType, Android.Net.Network? network, Java.Util.Concurrent.IExecutor executor, Android.Net.Nsd.NsdManager.IDiscoveryListener listener);
[<Android.Runtime.Register("discoverServices", "(Ljava/lang/String;ILandroid/net/Network;Ljava/util/concurrent/Executor;Landroid/net/nsd/NsdManager$DiscoveryListener;)V", "", ApiSince=33)>]
member this.DiscoverServices : string * Android.Net.Nsd.NsdProtocol * Android.Net.Network * Java.Util.Concurrent.IExecutor * Android.Net.Nsd.NsdManager.IDiscoveryListener -> unit

Parameters

serviceType
String
protocolType
NsdProtocol
network
Network
executor
IExecutor
Attributes

Applies to

DiscoverServices(String, NsdProtocol, NetworkRequest, IExecutor, NsdManager+IDiscoveryListener)

[Android.Runtime.Register("discoverServices", "(Ljava/lang/String;ILandroid/net/NetworkRequest;Ljava/util/concurrent/Executor;Landroid/net/nsd/NsdManager$DiscoveryListener;)V", "", ApiSince=33)]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")]
public void DiscoverServices (string serviceType, Android.Net.Nsd.NsdProtocol protocolType, Android.Net.NetworkRequest networkRequest, Java.Util.Concurrent.IExecutor executor, Android.Net.Nsd.NsdManager.IDiscoveryListener listener);
[<Android.Runtime.Register("discoverServices", "(Ljava/lang/String;ILandroid/net/NetworkRequest;Ljava/util/concurrent/Executor;Landroid/net/nsd/NsdManager$DiscoveryListener;)V", "", ApiSince=33)>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")>]
member this.DiscoverServices : string * Android.Net.Nsd.NsdProtocol * Android.Net.NetworkRequest * Java.Util.Concurrent.IExecutor * Android.Net.Nsd.NsdManager.IDiscoveryListener -> unit

Parameters

serviceType
String
protocolType
NsdProtocol
networkRequest
NetworkRequest
executor
IExecutor
Attributes

Applies to