# OpcDiscoveryClient Members

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcDiscoveryClient</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.client">Opc.UaFx.Client</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Constructors

### OpcDiscoveryClient

<span class="api-meta">4 overloads</span>

| Overload | Description |
|---|---|
| [OpcDiscoveryClient()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#opcdiscoveryclient-noparams) |  |
| [OpcDiscoveryClient(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#opcdiscoveryclient-system-string) |  |
| [OpcDiscoveryClient(Uri)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#opcdiscoveryclient-system-uri) |  |
| [OpcDiscoveryClient(Uri, OpcApplicationConfiguration)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#opcdiscoveryclient-system-uri-opc-uafx-opcapplicationconfiguration) |  |

#### OpcDiscoveryClient()

<div class="api-signature" data-lang="csharp">

```csharp
public OpcDiscoveryClient()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New()
```

</div>

#### OpcDiscoveryClient(string)

<div class="api-signature" data-lang="csharp">

```csharp
public OpcDiscoveryClient(string discoveryUrl)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(discoveryUrl As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `discoveryUrl` | [String](https://learn.microsoft.com/dotnet/api/system.string) |  |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) |  |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) |  |
| [FormatException](https://learn.microsoft.com/dotnet/api/system.formatexception) |  |

#### OpcDiscoveryClient(Uri)

<div class="api-signature" data-lang="csharp">

```csharp
public OpcDiscoveryClient(Uri discoveryUrl)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(discoveryUrl As Uri)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `discoveryUrl` | [Uri](https://learn.microsoft.com/dotnet/api/system.uri) |  |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) |  |

#### OpcDiscoveryClient(Uri, OpcApplicationConfiguration)

<div class="api-signature" data-lang="csharp">

```csharp
public OpcDiscoveryClient(
    Uri discoveryUrl,
    OpcApplicationConfiguration configuration)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<CLSCompliant(False)>
Public Sub New(
    discoveryUrl As Uri,
    configuration As OpcApplicationConfiguration)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `discoveryUrl` | [Uri](https://learn.microsoft.com/dotnet/api/system.uri) |  |
| `configuration` | [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) |  |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) |  |

## Properties

### Configuration

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEndpointConfiguration Configuration { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Configuration As OpcEndpointConfiguration
```

</div>

**Property value**

[OpcEndpointConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointconfiguration/)

### DiscoveryUrl

<div class="api-signature" data-lang="csharp">

```csharp
public Uri DiscoveryUrl { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property DiscoveryUrl As Uri
```

</div>

**Property value**

[Uri](https://learn.microsoft.com/dotnet/api/system.uri)

## Methods

### Close

<div class="api-signature" data-lang="csharp">

```csharp
public OpcStatus Close()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function Close() As OpcStatus
```

</div>

**Returns**

[OpcStatus](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatus/)

### DiscoverEndpoints

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [DiscoverEndpoints()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#discoverendpoints-noparams) | Discovers the endpoints of the server (OPC 10000-4, GetEndpoints). |
| [DiscoverEndpoints(IEnumerable&lt;string&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#discoverendpoints-system-collections-generic-ienumerable-of-system-string)<span class="api-meta">since v2.58</span> | Discovers the endpoints of the server which use one of the transport profiles specified (OPC 10000-4, GetEndpoints). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The server could not be reached or rejected the request, for example because it closed the channel during the handshake. The [Code](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/members#code) states the reason, such as [BadSecureChannelClosed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badsecurechannelclosed). |

#### DiscoverEndpoints()

Discovers the endpoints of the server (OPC 10000-4, GetEndpoints).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEndpointDescriptionCollection DiscoverEndpoints()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function DiscoverEndpoints() As OpcEndpointDescriptionCollection
```

</div>

**Returns**

[OpcEndpointDescriptionCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointdescriptioncollection/)

The endpoints the server returned.

#### DiscoverEndpoints(IEnumerable&lt;string&gt;)

<span class="api-meta">since v2.58</span>

Discovers the endpoints of the server which use one of the transport profiles specified (OPC 10000-4, GetEndpoints).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEndpointDescriptionCollection DiscoverEndpoints(
    IEnumerable<string> profileUris)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function DiscoverEndpoints(
    profileUris As IEnumerable(Of String)) As OpcEndpointDescriptionCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `profileUris` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[String](https://learn.microsoft.com/dotnet/api/system.string)&gt; | The URIs of the transport profiles the endpoints have to use, for example `http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary`. A null reference (Nothing in Visual Basic) or an empty sequence discovers the endpoints of every transport profile. |

**Returns**

[OpcEndpointDescriptionCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcendpointdescriptioncollection/)

The endpoints the server returned for the `profileUris`.

### DiscoverServers

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [DiscoverServers()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#discoverservers-noparams) | Discovers the servers known to the discovery server (OPC 10000-4, FindServers). |
| [DiscoverServers(IEnumerable&lt;string&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#discoverservers-system-collections-generic-ienumerable-of-system-string)<span class="api-meta">since v2.58</span> | Discovers the servers known to the discovery server whose application URI is one of the URIs specified (OPC 10000-4, FindServers). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The server could not be reached or rejected the request, for example because it closed the channel during the handshake. The [Code](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/members#code) states the reason, such as [BadSecureChannelClosed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badsecurechannelclosed). |

#### DiscoverServers()

Discovers the servers known to the discovery server (OPC 10000-4, FindServers).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcApplicationDescriptionCollection DiscoverServers()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function DiscoverServers() As OpcApplicationDescriptionCollection
```

</div>

**Returns**

[OpcApplicationDescriptionCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationdescriptioncollection/)

The servers the discovery server returned.

#### DiscoverServers(IEnumerable&lt;string&gt;)

<span class="api-meta">since v2.58</span>

Discovers the servers known to the discovery server whose application URI is one of the URIs specified (OPC 10000-4, FindServers).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcApplicationDescriptionCollection DiscoverServers(
    IEnumerable<string> serverUris)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function DiscoverServers(
    serverUris As IEnumerable(Of String)) As OpcApplicationDescriptionCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `serverUris` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[String](https://learn.microsoft.com/dotnet/api/system.string)&gt; | The application URIs of the servers to discover. A null reference (Nothing in Visual Basic) or an empty sequence discovers every server. |

**Returns**

[OpcApplicationDescriptionCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationdescriptioncollection/)

The servers the discovery server returned for the `serverUris`.

### Dispose

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [Dispose()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#dispose-noparams) | Releases all resources used by the [OpcDiscoveryClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/). |
| [Dispose(bool)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/members#dispose-system-boolean)<span class="api-meta">protected · virtual</span> | Releases the unmanaged resources used by the [OpcDiscoveryClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/) and optionally releases the managed resources. |

#### Dispose()

Releases all resources used by the [OpcDiscoveryClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/).

<div class="api-signature" data-lang="csharp">

```csharp
public void Dispose()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Dispose()
```

</div>

**Implements**

[Dispose()](https://learn.microsoft.com/dotnet/api/system.idisposable.dispose)

#### Dispose(bool)

<span class="api-meta">protected · virtual</span>

Releases the unmanaged resources used by the [OpcDiscoveryClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdiscoveryclient/) and optionally releases the managed resources.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void Dispose(bool disposing)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub Dispose(disposing As Boolean)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `disposing` | [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) | The value true to release both managed and unmanaged resources; otherwise the value false to release only unmanaged resources. |
