Struct DeclaredPort
- Namespace
- Unity.Multiplayer.Core
One port a server package listens on, declared so a host knows what to open, map or probe: the game port, and the health endpoint's.
public readonly struct DeclaredPort : IEquatable<DeclaredPort>
- Implements
- Inherited Members
Constructors
DeclaredPort(string, ushort, PortProtocol, string)
Declares a port.
public DeclaredPort(string name, ushort port, PortProtocol protocol, string purpose)
Parameters
namestringportushortprotocolPortProtocolpurposestring
Exceptions
- ArgumentException
nameis empty.- ArgumentOutOfRangeException
portis 0.
Fields
GameName
The game port's Name.
public const string GameName = "game"
Field Value
HealthName
The health endpoint port's Name.
public const string HealthName = "health"
Field Value
Properties
Name
A short name: GameName, HealthName, or a profile's own.
public string Name { get; }
Property Value
Port
The port number inside the server's machine or container.
public ushort Port { get; }
Property Value
Protocol
UDP or TCP.
public PortProtocol Protocol { get; }
Property Value
ProtocolName
udp or tcp, as Docker and firewalls write it.
public string ProtocolName { get; }
Property Value
Purpose
What it is for, in a sentence.
public string Purpose { get; }
Property Value
Methods
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
Equals(DeclaredPort)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(DeclaredPort other)
Parameters
otherDeclaredPortAn object to compare with this object.
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.