# OpcSubscription Members

> Reference: Provides information about a client initiated subscription.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcSubscription</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>

## Properties

### Diagnostics

Gets an instance of which provides diagnostic information about the operations performed and activities recognized on this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsubscription/).

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

```csharp
public OpcSubscriptionDiagnostics Diagnostics { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Diagnostics As OpcSubscriptionDiagnostics
```

</div>

**Property value**

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

An instance of the [OpcSubscriptionDiagnostics](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsubscriptiondiagnostics/) class with bunch of diagnostic information.

### Id

Gets the unique identifier of the subscription.

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

```csharp
public int Id { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Id As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The unique identifier of the subscription.

### MonitoredItemsCount

Gets the total number of monitored items observed through this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsubscription/).

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

```csharp
public int MonitoredItemsCount { get; }
```

</div>

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

```vbnet
Public ReadOnly Property MonitoredItemsCount As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The number of monitored items observed. The value also includes monitored items its monitoring may be disabled.

### Priority

Gets the priority used for publishing data change and event notifications.

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

```csharp
public int Priority { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Priority As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The priority of the subscription. The greater the number the earlier are pending notifications published to the client.

### PublishingInterval

Gets a value indicating the interval used to publish recent data change and event notifications in milliseconds.

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

```csharp
public double PublishingInterval { get; }
```

</div>

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

```vbnet
Public ReadOnly Property PublishingInterval As Double
```

</div>

**Property value**

[Double](https://learn.microsoft.com/dotnet/api/system.double)

The milliseconds used as the interval used for publishing.

### PublishingIsEnabled

Gets a value indicating whether the publishing of data change and event notifications is enabled for this subscription.

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

```csharp
public bool PublishingIsEnabled { get; }
```

</div>

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

```vbnet
Public ReadOnly Property PublishingIsEnabled As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if notifications are pusblished to the client; otherwise the value false.

### Session

Gets the session which owns this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsubscription/).

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

```csharp
public OpcSession Session { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Session As OpcSession
```

</div>

**Property value**

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

An instance of the [OpcSession](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/) class which owns this subscription.

## Methods

### Dispose

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

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

#### Dispose()

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

<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 [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsubscription/) 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. |

### GetMonitoredItems

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

Provides a sequence of [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmonitoreditem/) instances associated with this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsubscription/).

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

```csharp
public IEnumerable<OpcMonitoredItem> GetMonitoredItems()
```

</div>

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

```vbnet
Public Function GetMonitoredItems() As IEnumerable(Of OpcMonitoredItem)
```

</div>

**Returns**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmonitoreditem/)&gt;

An [IEnumerable&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcmonitoreditem/) instances.
