Struct HostIdentity
Identifies a machine that processes can be run on: the local machine, or a remote host.
Implements
Namespace: MediaBrowser.Model.System
Assembly: MediaBrowser.Model.dll
Syntax
public readonly struct HostIdentity : IEquatable<HostIdentity>
Remarks
A remote host is identified by its Id, not by how it is reached: its address and port can change while it remains the same machine.
Constructors
HostIdentity(String)
Initializes a new instance of the HostIdentity struct from the string form produced by ToString().
Declaration
public HostIdentity(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value |
|
Exceptions
| Type | Condition |
|---|---|
| System.FormatException |
|
Properties
Id
Gets the id of a remote host, or an empty id for the local host.
Declaration
public readonly Luid Id { get; }
Property Value
| Type | Description |
|---|---|
| Luid |
Local
Gets the identity of the local host.
Declaration
public static readonly HostIdentity Local { get; }
Property Value
| Type | Description |
|---|---|
| HostIdentity |
LocationType
Gets where the host is located.
Declaration
public readonly HostLocationType LocationType { get; }
Property Value
| Type | Description |
|---|---|
| HostLocationType |
Methods
Equals(HostIdentity)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(HostIdentity other)
Parameters
| Type | Name | Description |
|---|---|---|
| HostIdentity | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the current object is equal to the |
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override readonly bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the specified object is equal to the current object; otherwise, false. |
Overrides
GetHashCode()
Serves as the default hash function.
Declaration
public override readonly int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | A hash code for the current object. |
Overrides
RemoteSsh(Luid)
Creates the identity of a remote SSH host.
Declaration
public static HostIdentity RemoteSsh(Luid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Luid | id | The stable id of the remote host. |
Returns
| Type | Description |
|---|---|
| HostIdentity | The remote host identity. |
ToString()
Returns the string form that HostIdentity(String) accepts.
Declaration
public override readonly string ToString()
Returns
| Type | Description |
|---|---|
| System.String | An empty string for the local host, |
Overrides
Operators
Equality(HostIdentity, HostIdentity)
Returns a value that indicates whether the values of two HostIdentity objects are equal.
Declaration
public static bool operator ==(HostIdentity left, HostIdentity right)
Parameters
| Type | Name | Description |
|---|---|---|
| HostIdentity | left | The first value to compare. |
| HostIdentity | right | The second value to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the |
Inequality(HostIdentity, HostIdentity)
Returns a value that indicates whether two HostIdentity objects have different values.
Declaration
public static bool operator !=(HostIdentity left, HostIdentity right)
Parameters
| Type | Name | Description |
|---|---|---|
| HostIdentity | left | The first value to compare. |
| HostIdentity | right | The second value to compare. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if |