# OpcServer Class

> Reference: Represents an OPC UA server which provides the address space defined by its NodeManagers to its clients.

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

Represents an OPC UA server which provides the address space defined by its [NodeManagers](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#nodemanagers) to its clients.

## Syntax

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

```csharp
public class OpcServer : OpcServerBase
```

</div>

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

```vbnet
Public Class OpcServer
    Inherits OpcServerBase
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → [OpcApplicationInstance](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/)&lt;[OpcTransport](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctransport/), [OpcServerSecurity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserversecurity/)&gt; → [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) → **OpcServer**

## Implements

<ul class="api-implements">
<li><a href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></li>
<li><a href="../opc.uafx.iopcapplicationinstance/">IOpcApplicationInstance</a></li>
<li><a href="../opc.uafx.iopcnamespaceresolver/">IOpcNamespaceResolver</a></li>
</ul>

## Constructors

| Name | Description |
|---|---|
| [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#opcserver)<span class="api-meta">18 overloads</span> | Initializes a new instance of the OpcServer class using the [DefaultAddress](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#defaultaddress). |

## Fields

| Name | Description |
|---|---|
| [DefaultAddress](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#defaultaddress)<span class="api-meta">static</span> | Defines the default address (opc.tcp://localhost:4840) used by the constructors of the OpcServer which do not take an address. |

## Properties

| Name | Description |
|---|---|
| [DefaultNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#defaultnodemanager) | Gets the node manager used as the default node manager of the OpcServer. |
| [Diagnostics](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#diagnostics) | Gets the diagnostic summary information of the OpcServer. |
| [Discovery](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#discovery)<span class="api-meta">since v2.58</span> | Gets the settings the OpcServer uses to make itself known to discovery servers. |
| [EstimatedReturnTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#estimatedreturntime)<span class="api-meta">since v2.51</span> | Gets or sets a value indicating the time at which the OpcServer is expected to be running. |
| [Globalization](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#globalization)<span class="api-meta">since v2.11</span> | Gets the [OpcServerGlobalization](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverglobalization/) instance used to control the localization and other globalization related tasks. |
| [NodeManagers](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#nodemanagers) | Gets the node managers which provide the address space of the OpcServer. |
| [OperationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#operationlimits)<span class="api-meta">since v2.50</span> | Gets the [OpcOperationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcoperationlimits/) instance used to maintain the different operation limits used by the server. |
| [SystemContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#systemcontext)<span class="api-meta">override</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 OpcServer instance. |
| [UseDynamic](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#usedynamic)<span class="api-meta">since v2.53</span> | Gets or sets a value indicating whether the current OpcServer shall use generic types to represent dynamically defined custom types. |

## Methods

| Name | Description |
|---|---|
| [CreateConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#createconfiguration)<span class="api-meta">protected · override</span> | Creates the configuration of the OpcServer based on the configuration created by the base class. |
| [CreateOperationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#createoperationlimits)<span class="api-meta">protected · since v2.50</span> | Creates and initializes a new instance of the [OpcOperationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcoperationlimits/) which is used for the [OperationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#operationlimits) property. |
| [GetDataType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getdatatype)<span class="api-meta">6 overloads · since v2.22</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) object which is known under the `name` specified. |
| [GetDataTypes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getdatatypes)<span class="api-meta">since v2.22</span> | Retrieves all [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) objects offered by the [IOpcTypeProvider](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopctypeprovider/). |
| [GetDataTypeSystems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getdatatypesystems)<span class="api-meta">since v2.22</span> | Retrieves the systems used to describe the data exchanged via OPC UA. |
| [GetEndpoints](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getendpoints) | Retrieves the endpoints provided by the OpcServer. |
| [GetNodeType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getnodetype)<span class="api-meta">4 overloads · since v2.50</span> | Retrieves the [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) object which is known under the `name` specified. |
| [GetNodeTypes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getnodetypes)<span class="api-meta">since v2.50</span> | Retrieves all [OpcNodeTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodetypeinfo/) objects offered by the [IOpcTypeProvider](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopctypeprovider/). |
| [GetNodeTypeSystem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getnodetypesystem)<span class="api-meta">since v2.50</span> | Retrieves the system used to describe the structural organisation via OPC UA. |
| [GetSession](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getsession)<span class="api-meta">since v2.11</span> | Retrieves the [OpcSession](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/) associated with the `sessionId` specified. |
| [GetSessions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getsessions) | Retrieves all currently known sessions created on the current OpcServer. |
| [GetSubscriptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#getsubscriptions)<span class="api-meta">since v2.50</span> | Retrieves all currently known subscriptions created on the current OpcServer. |
| [OnCertificateChanged](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#oncertificatechanged)<span class="api-meta">protected · virtual · since v2.53</span> | Raises the [CertificateChanged](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#certificatechanged) event of the OpcServer. |
| [OnRequestJudgement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onrequestjudgement)<span class="api-meta">protected · virtual · since v2.19</span> | Raises the [RequestJudgement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestjudgement) event of the OpcServer. |
| [OnRequestProcessed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onrequestprocessed)<span class="api-meta">protected · virtual · since v2.7</span> | Raises the [RequestProcessed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestprocessed) event of the OpcServer. |
| [OnRequestProcessing](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onrequestprocessing)<span class="api-meta">protected · virtual · since v2.7</span> | Raises the [RequestProcessing](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestprocessing) event of the OpcServer. |
| [OnRequestValidated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onrequestvalidated)<span class="api-meta">protected · virtual · since v2.7</span> | Raises the [RequestValidated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestvalidated) event of the OpcServer. |
| [OnRequestValidating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onrequestvalidating)<span class="api-meta">protected · virtual · since v2.7</span> | Raises the [RequestValidating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestvalidating) event of the OpcServer. |
| [OnSessionActivated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onsessionactivated)<span class="api-meta">protected · virtual</span> | Raises the [SessionActivated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionactivated) event of the OpcServer. |
| [OnSessionActivating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onsessionactivating)<span class="api-meta">protected · virtual</span> | Raises the [SessionActivating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionactivating) event of the OpcServer. |
| [OnSessionActivationFailed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onsessionactivationfailed)<span class="api-meta">protected · virtual · since v2.58</span> | Raises the [SessionActivationFailed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionactivationfailed) event. |
| [OnSessionClosed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onsessionclosed)<span class="api-meta">protected · virtual</span> | Raises the [SessionClosed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionclosed) event of the OpcServer. |
| [OnSessionClosing](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onsessionclosing)<span class="api-meta">protected · virtual</span> | Raises the [SessionClosing](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionclosing) event of the OpcServer. |
| [OnSessionCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onsessioncreated)<span class="api-meta">protected · virtual</span> | Raises the [SessionCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessioncreated) event of the OpcServer. |
| [OnSessionCreating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onsessioncreating)<span class="api-meta">protected · virtual</span> | Raises the [SessionCreating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessioncreating) event of the OpcServer. |
| [OnSubscriptionCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onsubscriptioncreated)<span class="api-meta">protected · virtual</span> | Raises the [SubscriptionCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#subscriptioncreated) event of the OpcServer. |
| [OnSubscriptionDeleted](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#onsubscriptiondeleted)<span class="api-meta">protected · virtual</span> | Raises the [SubscriptionDeleted](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#subscriptiondeleted) event of the OpcServer. |
| [OnTypeResolve](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#ontyperesolve)<span class="api-meta">protected · virtual · since v2.53</span> | Raises the [TypeResolve](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#typeresolve) event of the OpcServer. |
| [RegisterNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#registernamespace)<span class="api-meta">3 overloads · since v2.50</span> | Registers the `namespaceUri` specified in the namespace table of the OpcServer unless it is already registered. |
| [RegisterNamespaces](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#registernamespaces)<span class="api-meta">6 overloads · since v2.50</span> | Registers each of the namespaces specified by the `namespaceUris` in the namespace table of the OpcServer unless it is already registered. |
| [ReportEvent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#reportevent)<span class="api-meta">7 overloads</span> | Produces a global event using the `eventNode` specified. |
| [ResumeCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#resumecore)<span class="api-meta">protected · override · since v2.11</span> | Resumes the suspended server by setting the state of its underlying server instance to running. |
| [StartCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#startcore)<span class="api-meta">protected · override</span> | Starts the server using the `configuration` specified. |
| [StopCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#stopcore)<span class="api-meta">protected · override</span> | Stops the server. |
| [SuspendCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#suspendcore)<span class="api-meta">protected · override · since v2.11</span> | Suspends the server by setting the state of its underlying server instance to suspended. |

## Events

| Name | Description |
|---|---|
| [CertificateChanged](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#certificatechanged)<span class="api-meta">since v2.53</span> | Occurs when a new certificate has been assigned to the OpcServer through a [OpcSession](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/) using an identity which is in the role [SecurityAdmin](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserversecurityroles/members#securityadmin). |
| [RequestJudgement](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestjudgement)<span class="api-meta">since v2.19</span> | Occurs when the validation of a request does not fulfill the requirements for a valid request. |
| [RequestProcessed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestprocessed)<span class="api-meta">since v2.7</span> | Occurs after the server processed a request, whether it succeeded or failed. |
| [RequestProcessing](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestprocessing)<span class="api-meta">since v2.7</span> | Occurs as soon as the server received a request, before it checks the session and the user and before it decodes the request into the type of its service. |
| [RequestValidated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestvalidated)<span class="api-meta">since v2.7</span> | Occurs after a request passed the validation, including the [RequestValidating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestvalidating) event, and right before the server processes it. |
| [RequestValidating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#requestvalidating)<span class="api-meta">since v2.7</span> | Occurs after the server checked the session and the user of a request and before it processes the request. |
| [SessionActivated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionactivated) | Occurs when a session of the OpcServer has been activated. |
| [SessionActivating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionactivating) | Occurs when a session of the OpcServer is about to be activated. |
| [SessionActivationFailed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionactivationfailed)<span class="api-meta">since v2.58</span> | Occurs when the server rejects the activation of a session. |
| [SessionClosed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionclosed) | Occurs when a session of the OpcServer has been closed. |
| [SessionClosing](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessionclosing) | Occurs when a session of the OpcServer is about to be closed. |
| [SessionCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessioncreated) | Occurs when a new session has been created on the OpcServer. |
| [SessionCreating](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#sessioncreating) | Occurs when a new session is about to be created on the OpcServer. |
| [SubscriptionCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#subscriptioncreated) | Occurs when a new subscription is created through a [OpcSession](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/). |
| [SubscriptionDeleted](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#subscriptiondeleted) | Occurs when an existing subscription of a [OpcSession](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcsession/) has been deleted. |
| [TypeResolve](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#typeresolve)<span class="api-meta">since v2.53</span> | Occurs before the resolution of a data type takes place. |

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).

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
