Table of Contents

Class Endpoint

Namespace
Foundation.Data.Doublets.Cli.Ipc
Assembly
Foundation.Data.Doublets.Cli.dll

A parsed endpoint string, [kind:]address[?name=value&...] (issue #140).

public sealed class Endpoint : IEquatable<Endpoint>
Inheritance
Endpoint
Implements
Inherited Members

Remarks

Text without a known kind prefix is a TCP host:port, so every address accepted before IPC endpoints existed keeps its meaning. The grammar and the options of every kind are those of docs/protocol/ipc-transports-v1.md.

Properties

Address

Everything between the kind and the options.

public string Address { get; }

Property Value

string

Kind

The kind, lowercase, such as tcp or shm.

public string Kind { get; }

Property Value

string

Options

Every option, sorted by name.

public IReadOnlyDictionary<string, string> Options { get; }

Property Value

IReadOnlyDictionary<string, string>

Timeout

The connect and handshake timeout (timeout, 10 s by default), at least 1 ms.

public TimeSpan Timeout { get; }

Property Value

TimeSpan

Methods

Equals(Endpoint?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Endpoint? other)

Parameters

other Endpoint

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Millis(string, ulong)

A duration option given in milliseconds, or fallback milliseconds.

public TimeSpan Millis(string name, ulong fallback)

Parameters

name string
fallback ulong

Returns

TimeSpan

Number(string, ulong, ulong, ulong)

A numeric option within min..=max, or fallback.

public ulong Number(string name, ulong fallback, ulong min, ulong max)

Parameters

name string
fallback ulong
min ulong
max ulong

Returns

ulong

Option(string)

The raw value of an option, or null.

public string? Option(string name)

Parameters

name string

Returns

string

Parse(string)

Parses an endpoint string.

public static Endpoint Parse(string text)

Parameters

text string

Returns

Endpoint

Exceptions

IpcException

The text is not a valid endpoint.

ToString()

The endpoint as text: kind[:address][?name=value&...].

public override string ToString()

Returns

string

TryParse(string, out Endpoint?)

Parses text; false when it is not a valid endpoint.

public static bool TryParse(string text, out Endpoint? endpoint)

Parameters

text string
endpoint Endpoint

Returns

bool