Class Endpoint
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
Kind
The kind, lowercase, such as tcp or shm.
public string Kind { get; }
Property Value
Options
Every option, sorted by name.
public IReadOnlyDictionary<string, string> Options { get; }
Property Value
Timeout
The connect and handshake timeout (timeout, 10 s by default), at least 1 ms.
public TimeSpan Timeout { get; }
Property Value
Methods
Equals(Endpoint?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Endpoint? other)
Parameters
otherEndpointAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
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
Returns
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
Returns
Option(string)
The raw value of an option, or null.
public string? Option(string name)
Parameters
namestring
Returns
Parse(string)
Parses an endpoint string.
public static Endpoint Parse(string text)
Parameters
textstring
Returns
Exceptions
- IpcException
The text is not a valid endpoint.
ToString()
The endpoint as text: kind[:address][?name=value&...].
public override string ToString()
Returns
TryParse(string, out Endpoint?)
Parses text; false when it is not a valid endpoint.
public static bool TryParse(string text, out Endpoint? endpoint)