Struct
ListeningPort
Provides a structure to contain a listener port for an ListeningHost instance.
public readonly struct ListeningPort : IEquatable<ListeningPort>, IParsable<ListeningPort>Implements #
IEquatable<ListeningPort>, IParsable<ListeningPort>
Inherited Members #
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
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 #
| Name | Description |
|---|---|
| ListeningPort() | Creates an new ListeningPort instance with default parameters. |
| 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. |
| ListeningPort(bool, string, ushort) | Creates an new ListeningPort instance with the specified port, secure context and hostname. |
| ListeningPort(bool, string, ushort, string) | Creates an new ListeningPort instance with the specified port, secure context, hostname and path. |
| ListeningPort(string) | Creates an new ListeningPort instance with the specified URI. |
Properties #
| Name | Description |
|---|---|
| Hostname | Gets the DNS hostname pattern where this listening port will refer. |
| IsPathRoot | Gets an boolean indicating if this listening port has an non-rooted path. |
| Path | Gets where this listening port prefix is listening to. |
| Port | Gets the port where this listening port will refer. |
| Secure | Gets whether the server should listen to this port securely (SSL). |
Methods #
| Name | Description |
|---|---|
| Equals(object?) | Determines if another object is equals to this class instance. |
| Equals(ListeningPort) | Determines if this ListeningPort is equals to another ListeningPort. |
| GetHashCode() | Gets the hash code for this listening port. |
| GetRandomPort() | Gets an ListeningPort object with an random insecure port at the default loopback address. |
| Parse(string) | Parses a string into a ListeningPort. |
| Parse(string, IFormatProvider?) | Parses a string into a ListeningPort. |
| ResolveListeningIPAddress() | Resolves the listening IP address from the hostname. |
| ToString() | Gets an string representation of this ListeningPort. |
| ToString(bool) | Gets an string representation of this ListeningPort. |
| TryParse(string?, IFormatProvider?, out ListeningPort) | Tries to parse a string into a ListeningPort. |
Operators #
| Name | Description |
|---|---|
| operator ==(ListeningPort, ListeningPort) | |
| operator !=(ListeningPort, ListeningPort) |