Unosquare
    Show / Hide Table of Contents

    Class HttpListener

    The EmbedIO implementation of the standard HTTP Listener class.

    Based on MONO HttpListener class.

    Inheritance
    Object
    HttpListener
    Implements
    IHttpListener
    IDisposable
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: EmbedIO.Net
    Syntax
    public sealed class HttpListener : IHttpListener, IDisposable

    Constructors

    HttpListener(Nullable<X509Certificate>)

    Initializes a new instance of the HttpListener class.

    Declaration
    public HttpListener(X509Certificate? certificate = default(X509Certificate? ))
    Parameters
    Type Name Description
    Nullable<X509Certificate> certificate

    The certificate.

    Properties

    IgnoreWriteExceptions

    Gets or sets a value indicating whether the listener should ignore write exceptions. By default the flag is set on.

    Declaration
    public bool IgnoreWriteExceptions { get; set; }
    Property Value
    Type Description
    Boolean

    true if [ignore write exceptions]; otherwise, false.

    IsListening

    Gets a value indicating whether this instance is listening.

    Declaration
    public bool IsListening { get; }
    Property Value
    Type Description
    Boolean

    true if this instance is listening; otherwise, false.

    Name

    Gets or sets the name.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String

    The name.

    Prefixes

    Gets the prefixes.

    Declaration
    public List<string> Prefixes { get; }
    Property Value
    Type Description
    List<String>

    The prefixes.

    Methods

    AddPrefix(String)

    Adds the prefix.

    Declaration
    public void AddPrefix(string urlPrefix)
    Parameters
    Type Name Description
    String urlPrefix

    The URL prefix.

    Dispose()

    Declaration
    public void Dispose()

    GetContextAsync(CancellationToken)

    Gets the HTTP context asynchronous.

    Declaration
    public Task<IHttpContextImpl> GetContextAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<IHttpContextImpl>

    A task that represents the time delay for the HTTP Context.

    Start()

    Starts this listener.

    Declaration
    public void Start()

    Stop()

    Stops this listener.

    Declaration
    public void Stop()

    Implements

    IHttpListener
    IDisposable

    Comments

    Back to top Copyright © 2017-2019 Unosquare