Search Results for

    Show / Hide Table of Contents

    Class UdpRelayListener

    Relays UDP datagrams between clients and an upstream with one session per client endpoint. A single receive loop reads the listening socket; the first datagram from a client endpoint picks an upstream (a cluster destination through the load balancer, or the fixed forward host), connects a UDP socket to it, and later datagrams from that endpoint reuse the socket. Each session has its own upstream receive loop that sends replies back through the listening socket to that client endpoint only. Idle sessions are closed by a timer wheel, so no session owns a timer. The listener has no connection to any HTTP path.

    Inheritance
    object
    UdpRelayListener
    Implements
    IAsyncDisposable
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Titanium.Web.Proxy.Udp
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    public sealed class UdpRelayListener : IAsyncDisposable, IDisposable

    Constructors

    | Edit this page View Source

    UdpRelayListener(UdpRelayOptions, ClusterManager?, LoadBalancer?)

    Declaration
    public UdpRelayListener(UdpRelayOptions options, ClusterManager? clusters = null, LoadBalancer? loadBalancer = null)
    Parameters
    Type Name Description
    UdpRelayOptions options

    Listener settings. Copy semantics: later changes to the object are not observed.

    ClusterManager clusters

    Cluster manager that owns destination state. Required with ClusterId.

    LoadBalancer loadBalancer

    Picks the destination for a new session. Required with ClusterId.

    Properties

    | Edit this page View Source

    ActiveSessions

    Sessions open right now.

    Declaration
    public int ActiveSessions { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    IsDraining

    True after BeginDrain(). A draining listener relays existing sessions and opens no new one.

    Declaration
    public bool IsDraining { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    LocalEndPoint

    The bound address and port. Null before Start().

    Declaration
    public IPEndPoint? LocalEndPoint { get; }
    Property Value
    Type Description
    IPEndPoint

    Methods

    | Edit this page View Source

    BeginDrain()

    Stops opening sessions. Datagrams on open sessions keep flowing until they go idle.

    Declaration
    public void BeginDrain()
    | Edit this page View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    | Edit this page View Source

    DisposeAsync()

    Closes every session and the listening socket.

    Declaration
    public ValueTask DisposeAsync()
    Returns
    Type Description
    ValueTask
    | Edit this page View Source

    DrainAsync(TimeSpan)

    Calls BeginDrain() and waits until every session has closed or timeout passes, whichever is first. Returns true when no session is left.

    Declaration
    public Task<bool> DrainAsync(TimeSpan timeout)
    Parameters
    Type Name Description
    TimeSpan timeout
    Returns
    Type Description
    Task<bool>
    | Edit this page View Source

    Start()

    Binds the socket and starts the receive loop and the idle sweep.

    Declaration
    public void Start()

    Implements

    IAsyncDisposable
    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX