Table of Contents

Interface ILoopbackPeerCheck

Namespace
VpnHood.AppUi.Hosting.Desktop.Platform
Assembly
VpnHood.AppUi.Hosting.Desktop.dll

Defines how a process checks that the far end of a loopback connection it made belongs to the process it meant to reach, as far as the platform can tell.

public interface ILoopbackPeerCheck

Remarks

The service frees a dead listener's port before its channel names the next, and anyone may take it. Windows reads the owning process from its TCP table; Linux checks the owning user; the Windows plug-in, whose app runs in the window's process, checks only that the process meant is this one.

Methods

IsOwnedBy(IPEndPoint, IPEndPoint, int, CancellationToken)

Checks whether the far end of a loopback connection belongs to a process, as far as the platform can tell.

Task<bool> IsOwnedBy(IPEndPoint local, IPEndPoint remote, int processId, CancellationToken cancellationToken)

Parameters

local IPEndPoint

The connection's local end.

remote IPEndPoint

The connection's remote end.

processId int

The ID of the process meant to own the remote end.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<bool>

A task whose result is true where the platform's check passes.

Exceptions

OperationCanceledException

cancellationToken was canceled.