# OpcDiscoveryServer Members

> Reference: Represents a discovery server with which servers register and which provides the registered servers to clients.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcDiscoveryServer</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.server">Opc.UaFx.Server</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

Inherits members from [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members), [OpcApplicationInstance&lt;OpcTransport, OpcServerSecurity&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members).

## Constructors

### OpcDiscoveryServer

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

| Overload | Description |
|---|---|
| [OpcDiscoveryServer()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/members#opcdiscoveryserver-noparams) | Initializes a new instance of the [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) class using the address "opc.tcp://localhost:4840". |
| [OpcDiscoveryServer(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/members#opcdiscoveryserver-system-string) | Initializes a new instance of the [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) class using the `address` specified. |
| [OpcDiscoveryServer(Uri)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/members#opcdiscoveryserver-system-uri) | Initializes a new instance of the [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) class using the `address` specified. |

#### OpcDiscoveryServer()

Initializes a new instance of the [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) class using the address "opc.tcp://localhost:4840".

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

```csharp
public OpcDiscoveryServer()
```

</div>

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

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

</div>

#### OpcDiscoveryServer(string)

Initializes a new instance of the [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) class using the `address` specified.

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

```csharp
public OpcDiscoveryServer(string address)
```

</div>

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

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `address` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [string](https://learn.microsoft.com/dotnet/api/system.string) representation of the address of the discovery server which needs to use one of the supported schemes 'opc.tcp' and 'https'. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `address` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty) or is not an absolute URI using one of the supported schemes 'opc.tcp' and 'https'. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `address` is a null reference (Nothing in Visual Basic). |

#### OpcDiscoveryServer(Uri)

Initializes a new instance of the [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) class using the `address` specified.

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

```csharp
public OpcDiscoveryServer(Uri address)
```

</div>

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

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `address` | [Uri](https://learn.microsoft.com/dotnet/api/system.uri) | The [Uri](https://learn.microsoft.com/dotnet/api/system.uri) of the address of the discovery server which needs to use one of the supported schemes 'opc.tcp' and 'https'. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `address` does not use one of the supported schemes 'opc.tcp' and 'https'. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `address` is a null reference (Nothing in Visual Basic). |

## Properties

### SystemContext

<span class="api-meta">override · since v2.11</span>

Gets the [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) which is used to store the context sensitive data and configuration used by the current [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) instance.

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

```csharp
public override OpcContext SystemContext { get; }
```

</div>

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

```vbnet
Public Overrides ReadOnly Property SystemContext As OpcContext
```

</div>

**Property value**

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

An instance of the [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) class which might be at least [Empty](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/members#empty).

**Overrides**

[SystemContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#systemcontext)

## Methods

### CreateConfiguration

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

Creates the configuration which is used to start the discovery server.

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

```csharp
protected override OpcApplicationConfiguration CreateConfiguration()
```

</div>

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

```vbnet
<CLSCompliant(False)>
Protected Overrides Function CreateConfiguration() As OpcApplicationConfiguration
```

</div>

**Returns**

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

The [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) created by the base class. If it defines no security policy for the discovery server, a policy using the security mode SignAndEncrypt and the security policy Basic128Rsa15 is added.

**Overrides**

[CreateConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#createconfiguration)

### StartCore

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

Starts the discovery server using the `configuration` specified.

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

```csharp
protected override void StartCore(OpcApplicationConfiguration configuration)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Protected Overrides Sub StartCore(configuration As OpcApplicationConfiguration)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `configuration` | [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) | The [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) to use to start the discovery server. |

**Overrides**

[StartCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#startcore)

### StopCore

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

Stops the discovery server.

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

```csharp
protected override void StopCore()
```

</div>

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

```vbnet
Protected Overrides Sub StopCore()
```

</div>

**Overrides**

[StopCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#stopcore)
