Struct ListeningPort
Provides a structure to contain a listener port for an ListeningHost instance.
public readonly struct ListeningPort : IEquatable<ListeningPort>, IParsable<ListeningPort>
- Implements
- Inherited Members
Examples
A listener port represents an access point on the HTTP server. It consists of an indicator that it should use a secure connection (HTTPS), its hostname and port.
It must start with https:// or http://, and must terminate with an /.
It is represented by the syntax:
[http|https]://[hostname]:[port]/
Examples:
http://localhost:80/
https://subdomain.domain.net:443/
http://182.32.112.223:5251/
Constructors
- ListeningPort()
Creates an new ListeningPort instance with default parameters.
- ListeningPort(bool, string, ushort)
Creates an new ListeningPort instance with the specified port, secure context and hostname.
- ListeningPort(string)
Creates an new ListeningPort instance with the specified URI.
- ListeningPort(ushort)
Creates an new ListeningPort instance with the specified port at the loopback host.
- ListeningPort(ushort, bool)
Creates an new ListeningPort instance with the specified port and secure context at the loopback host.
Properties
- Hostname
Gets or sets the DNS hostname pattern where this listening port will refer.
- Port
Gets or sets the port where this listening port will refer.
- Secure
Gets or sets whether the server should listen to this port securely (SSL).
Methods
- Equals(ListeningPort)
Determines if this ListeningPort is equals to another ListeningPort.
- Equals(object?)
Determines if another object is equals to this class instance.
- GetHashCode()
Gets the hash code for this listening port.
- GetRandomPort()
Gets an ListeningPort object with an random insecure port at the default loopback address.
- ToString()
Gets an string representation of this ListeningPort.
Explicit Interface Implementations
- Parse(string, IFormatProvider?)
Parses a string into a ListeningPort.
- TryParse(string?, IFormatProvider?, out ListeningPort)
Tries to parse a string into a ListeningPort.