Table of Contents

Class WindowsLoopbackPeerCheck

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

Provides who owns the far end of an IPv4 loopback connection on Windows: the process its TCP table row names.

public sealed class WindowsLoopbackPeerCheck : ILoopbackPeerCheck
Inheritance
WindowsLoopbackPeerCheck
Implements
Inherited Members

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.

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

Remarks

The row may lag a connect by a moment, so it is read up to ten times, 10 ms apart, before the answer is no.

Exceptions

OperationCanceledException

cancellationToken was canceled.

OperationCanceledException

cancellationToken was canceled.