# OpcSocketIdentity Members

> Reference: Represents the local and the remote endpoint of a connection (see Socket).

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

## Constructors

### OpcSocketIdentity

Initializes a new instance of the [OpcSocketIdentity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsocketidentity/) class using the `localEndpoint` and `remoteEndpoint` specified.

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

```csharp
public OpcSocketIdentity(EndPoint localEndpoint, EndPoint remoteEndpoint)
```

</div>

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

```vbnet
Public Sub New(localEndpoint As EndPoint, remoteEndpoint As EndPoint)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `localEndpoint` | [EndPoint](https://learn.microsoft.com/dotnet/api/system.net.endpoint) | The local endpoint of the connection. |
| `remoteEndpoint` | [EndPoint](https://learn.microsoft.com/dotnet/api/system.net.endpoint) | The remote endpoint of the connection. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `localEndpoint` or the `remoteEndpoint` is a null reference (Nothing in Visual Basic). |

## Properties

### LocalEndpoint

Gets the local endpoint of the connection.

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

```csharp
public EndPoint LocalEndpoint { get; }
```

</div>

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

```vbnet
Public ReadOnly Property LocalEndpoint As EndPoint
```

</div>

**Property value**

[EndPoint](https://learn.microsoft.com/dotnet/api/system.net.endpoint)

The local endpoint of the connection.

### RemoteEndpoint

Gets the remote endpoint of the connection.

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

```csharp
public EndPoint RemoteEndpoint { get; }
```

</div>

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

```vbnet
Public ReadOnly Property RemoteEndpoint As EndPoint
```

</div>

**Property value**

[EndPoint](https://learn.microsoft.com/dotnet/api/system.net.endpoint)

The remote endpoint of the connection.

## Methods

### ToString

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

Returns a string that represents the connection.

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

```csharp
public override string ToString()
```

</div>

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

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A string containing the [LocalEndpoint](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsocketidentity/members#localendpoint) and the [RemoteEndpoint](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcsocketidentity/members#remoteendpoint).

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)
